I'm trying to get started with OB by using this page http://objectbox.io/documentation/introduction/
I create a new project in Android Studio 2.3.3
My Gradle files:
ROOT:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url "http://objectbox.net/beta-repo/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "io.objectbox:objectbox-gradle-plugin:1.0.1"
}
}
allprojects {
repositories {
jcenter()
maven { url "http://objectbox.net/beta-repo/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
APP:
apply plugin: 'com.android.application'
apply plugin: 'io.objectbox'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.obox"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile "io.objectbox:objectbox-android:1.0.1"
annotationProcessor "io.objectbox:objectbox-processor:1.0.1"
}
It doesn't work with and without 2 lower lines in the APP-gradle file.
My entity class:
package com.example.obox;
import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;
@Entity
public class MyModel {
@Id
private long id;
private String content;
}
No generated code added. So I get errors while trying to make the project.
.../MyModelCursor.java
Error:(45, 32) error: cannot find symbol method getContent()
Error:(48, 57) error: cannot find symbol method getId()
Error:(56, 15) error: cannot find symbol method setId(long)
.../MyModel_.java
Error:(91, 26) error: cannot find symbol method getId()
ObjectBox does not generate code into your source files (unlike greenDAO). So you have two options:
private