New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Kotlin support #9

Closed
greenrobot opened this Issue Jan 24, 2017 · 56 comments

Comments

Projects
None yet
7 participants
@greenrobot
Member

greenrobot commented Jan 24, 2017

Right now entities must be defined in Java. This is because the ObjectBox Gradle plugin uses JDT to parse and modify Java code.

Possible options:

  • Find (wait for) a Kotlin AST library like JDT
  • (Also) support plain annotation processing with its limitations (no modifications of existing sources)
  • ?
@EricKuck

This comment has been minimized.

Show comment
Hide comment
@EricKuck

EricKuck Jan 25, 2017

FWIW, I don't view not being able to change source files to be a bad thing. I never, ever want a library to change code that I have written. I would view using the standard annotation processor as a big upgrade, not only because it would add support for Kotlin/Scala/Groovy/whatever, but because it would leave my files alone.

FWIW, I don't view not being able to change source files to be a bad thing. I never, ever want a library to change code that I have written. I would view using the standard annotation processor as a big upgrade, not only because it would add support for Kotlin/Scala/Groovy/whatever, but because it would leave my files alone.

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jan 25, 2017

Member

+EricKuck I see your point. Just a few comments on that: technically, ObjectBox never touches code you have written. It only adds code to your class or replaces previously generated code. Other tools do byte code manipulation, which can get confusing during debugging. One could say ObjectBox is fully transparent about those changes and see this as an advantage even.

Member

greenrobot commented Jan 25, 2017

+EricKuck I see your point. Just a few comments on that: technically, ObjectBox never touches code you have written. It only adds code to your class or replaces previously generated code. Other tools do byte code manipulation, which can get confusing during debugging. One could say ObjectBox is fully transparent about those changes and see this as an advantage even.

@EricKuck

This comment has been minimized.

Show comment
Hide comment
@EricKuck

EricKuck Jan 25, 2017

I agree that bytecode weaving isn't ideal, but annotation processing doesn't typically do that. I haven't looked into what this project uses code manipulation for enough to know if an apt dependency would cover everything, but it would be a huge upgrade to switch to something like this if it did.

I agree that bytecode weaving isn't ideal, but annotation processing doesn't typically do that. I haven't looked into what this project uses code manipulation for enough to know if an apt dependency would cover everything, but it would be a huge upgrade to switch to something like this if it did.

@greenrobot greenrobot added the feature label Jan 28, 2017

@Miha-x64

This comment has been minimized.

Show comment
Hide comment
@Miha-x64

Miha-x64 Jan 30, 2017

As examples say, ObjectBox (and GreenDAO) need our models to have all-arg-constructor, no-arg constructor, and getters/setters.
In Kotlin, a primary constructor with all default values specified yields a compiler to generate both all-arg and no-arg constructors. And getters/setters are exist in Kotlin by default.
So, ObjectBox just should force us to declare all default values in a primary constructor.

As examples say, ObjectBox (and GreenDAO) need our models to have all-arg-constructor, no-arg constructor, and getters/setters.
In Kotlin, a primary constructor with all default values specified yields a compiler to generate both all-arg and no-arg constructors. And getters/setters are exist in Kotlin by default.
So, ObjectBox just should force us to declare all default values in a primary constructor.

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jan 30, 2017

Member

ObjectBox just should force us to declare all default values in a primary constructor.

The "force us" might be the problem. The big constructor expects the parameters in a certain order, for example. Potential for big trouble if left to humans... 🤖

Member

greenrobot commented Jan 30, 2017

ObjectBox just should force us to declare all default values in a primary constructor.

The "force us" might be the problem. The big constructor expects the parameters in a certain order, for example. Potential for big trouble if left to humans... 🤖

@LouisCAD

This comment has been minimized.

Show comment
Hide comment
@LouisCAD

LouisCAD Jan 30, 2017

@greenrobot There could be a check at compile time, and maybe a lint too to prevent us from compiling and shipping such an app with mis-ordered all parameters constructor.

LouisCAD commented Jan 30, 2017

@greenrobot There could be a check at compile time, and maybe a lint too to prevent us from compiling and shipping such an app with mis-ordered all parameters constructor.

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jan 30, 2017

Member

And there also should be some fallback. Some plan B that works without the constructor.

Member

greenrobot commented Jan 30, 2017

And there also should be some fallback. Some plan B that works without the constructor.

@Miha-x64

This comment has been minimized.

Show comment
Hide comment
@Miha-x64

Miha-x64 Jan 30, 2017

The big constructor expects the parameters in a certain order

GreenDAO uses such constructors from generated classes.
And humans can (and should) use named arguments.

Miha-x64 commented Jan 30, 2017

The big constructor expects the parameters in a certain order

GreenDAO uses such constructors from generated classes.
And humans can (and should) use named arguments.

@LouisCAD

This comment has been minimized.

Show comment
Hide comment
@LouisCAD

LouisCAD Jan 31, 2017

Hope this issue is resolved before ObjectBox leaves beta status

Hope this issue is resolved before ObjectBox leaves beta status

sebaslogen added a commit to sebaslogen/KotlinWeatherApp that referenced this issue Feb 22, 2017

Configure ObjectBox
FAiling due to @id annotation not yet supported for Kotlin
objectbox/objectbox-java#9
@carmas123

This comment has been minimized.

Show comment
Hide comment

+1

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jun 1, 2017

Member

Internally, we have the first Kotlin entities (data classes) running with ObjectBox.

Next step is to look into how to improve the API specific to Kotlin, for example with extension functions. An obvious improvement would be BoxStore.boxFor to work nicely with KClass.

Any other ideas?

Member

greenrobot commented Jun 1, 2017

Internally, we have the first Kotlin entities (data classes) running with ObjectBox.

Next step is to look into how to improve the API specific to Kotlin, for example with extension functions. An obvious improvement would be BoxStore.boxFor to work nicely with KClass.

Any other ideas?

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jun 28, 2017

Member

We just released a release candidate with full Kotlin support. Please give version "0.9.13-RC" a try!

Check the Kotlin docs and the example project (currently only in dev branch).

Because this is a rather big update, we would like to get some feedback early on. Thanks!!

Member

greenrobot commented Jun 28, 2017

We just released a release candidate with full Kotlin support. Please give version "0.9.13-RC" a try!

Check the Kotlin docs and the example project (currently only in dev branch).

Because this is a rather big update, we would like to get some feedback early on. Thanks!!

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 9, 2017

have tried the version 0.9.13-RC, however am getting this error, Error:(33, 20) Unresolved reference: MyObjectBox. How do I resolve this?

have tried the version 0.9.13-RC, however am getting this error, Error:(33, 20) Unresolved reference: MyObjectBox. How do I resolve this?

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 9, 2017

Member

@jumadeveloper Did you try to build the projects first? This class is generated during build.

Member

greenrobot commented Jul 9, 2017

@jumadeveloper Did you try to build the projects first? This class is generated during build.

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 9, 2017

@greenrobot I have tried several times. Still no luck, When i switch to Java Model, it works just fine. I dont think am missing anything, because I have been using Objectbox for a while

@greenrobot I have tried several times. Still no luck, When i switch to Java Model, it works just fine. I dont think am missing anything, because I have been using Objectbox for a while

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 9, 2017

I have retried, still not working. That's the only issue am getting : Unresolved reference: MyObjectBox.

jumaallan commented Jul 9, 2017

I have retried, still not working. That's the only issue am getting : Unresolved reference: MyObjectBox.

@greenrobot greenrobot added this to the 0.9.13 milestone Jul 10, 2017

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 10, 2017

Member

@jumadeveloper Does this occur in Android Studio? Did you check building with gradlew?

Member

greenrobot commented Jul 10, 2017

@jumadeveloper Does this occur in Android Studio? Did you check building with gradlew?

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 10, 2017

Member

There's a new version "0.9.13-RC2" with fixes for transient lists etc.

Member

greenrobot commented Jul 10, 2017

There's a new version "0.9.13-RC2" with fixes for transient lists etc.

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 10, 2017

@greenrobot Yes, this occurs with Android Studio. Just added the 0.9.13-RC2 dependency, synced gradle, but getting the error during run. See my code snippets for my model, and my gradle files. Am not sure if there is something am missing here.

User Model
`package com.androidstudy.kotlinretrofitobjectbox.models

import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id

/**

  • Created by Juma on 7/9/2017.
    */

@entity
data class User(
@id var id: Long = 0,
val first_name: String,
val last_name: String,
val username: String,
val email: String,
val password: String,
val image: String
)`

Build.gradle (Project)
`// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.3-2'
ext.objectBoxVersion = "0.9.13-RC2"
repositories {
jcenter()
maven { url "http://objectbox.net/beta-repo/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.objectbox:objectbox-gradle-plugin:$objectBoxVersion"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
maven { url "http://objectbox.net/beta-repo/" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
`

build.gradle (app)
`apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.objectbox.android.transform'

android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.androidstudy.kotlinretrofitobjectbox"
minSdkVersion 10
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'build/generated/source/objectbox'
}
}

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'
})
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.2'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

compile "io.objectbox:objectbox-android:$objectBoxVersion"
compile "io.objectbox:objectbox-kotlin:$objectBoxVersion"
kapt "io.objectbox:objectbox-processor:$objectBoxVersion"

compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'

}
repositories {
mavenCentral()
}
And this is my App.ktpackage com.androidstudy.kotlinretrofitobjectbox

/**

  • Created by Juma on 7/9/2017.
    */
    import android.app.Application
    import android.os.Environment

import java.io.File

import io.objectbox.BoxStore

class App : Application() {

companion object Constants {
    const val TAG = "ObjectBoxExample"
    const val EXTERNAL_DIR = false
}

lateinit var boxStore: BoxStore
    private set

override fun onCreate() {
    super.onCreate()

    //        if (EXTERNAL_DIR) {
    //            // Example how you could use a custom dir in "external storage"
    //            // (Android 6+ note: give the app storage permission in app info settings)
    //            File directory = new File(Environment.getExternalStorageDirectory(), "objectbox-notes");
    //            boxStore = MyObjectBox.builder().androidContext(App.this).directory(directory).build();
    //        } else {
    // This is the minimal setup required on Android
    boxStore = MyObjectBox.builder().androidContext(this).build()
    //        }
}

}`

@greenrobot Yes, this occurs with Android Studio. Just added the 0.9.13-RC2 dependency, synced gradle, but getting the error during run. See my code snippets for my model, and my gradle files. Am not sure if there is something am missing here.

User Model
`package com.androidstudy.kotlinretrofitobjectbox.models

import io.objectbox.annotation.Entity
import io.objectbox.annotation.Id

/**

  • Created by Juma on 7/9/2017.
    */

@entity
data class User(
@id var id: Long = 0,
val first_name: String,
val last_name: String,
val username: String,
val email: String,
val password: String,
val image: String
)`

Build.gradle (Project)
`// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.3-2'
ext.objectBoxVersion = "0.9.13-RC2"
repositories {
jcenter()
maven { url "http://objectbox.net/beta-repo/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.objectbox:objectbox-gradle-plugin:$objectBoxVersion"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
maven { url "http://objectbox.net/beta-repo/" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
`

build.gradle (app)
`apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.objectbox.android.transform'

android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.androidstudy.kotlinretrofitobjectbox"
minSdkVersion 10
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'build/generated/source/objectbox'
}
}

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'
})
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.2'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

compile "io.objectbox:objectbox-android:$objectBoxVersion"
compile "io.objectbox:objectbox-kotlin:$objectBoxVersion"
kapt "io.objectbox:objectbox-processor:$objectBoxVersion"

compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'

}
repositories {
mavenCentral()
}
And this is my App.ktpackage com.androidstudy.kotlinretrofitobjectbox

/**

  • Created by Juma on 7/9/2017.
    */
    import android.app.Application
    import android.os.Environment

import java.io.File

import io.objectbox.BoxStore

class App : Application() {

companion object Constants {
    const val TAG = "ObjectBoxExample"
    const val EXTERNAL_DIR = false
}

lateinit var boxStore: BoxStore
    private set

override fun onCreate() {
    super.onCreate()

    //        if (EXTERNAL_DIR) {
    //            // Example how you could use a custom dir in "external storage"
    //            // (Android 6+ note: give the app storage permission in app info settings)
    //            File directory = new File(Environment.getExternalStorageDirectory(), "objectbox-notes");
    //            boxStore = MyObjectBox.builder().androidContext(App.this).directory(directory).build();
    //        } else {
    // This is the minimal setup required on Android
    boxStore = MyObjectBox.builder().androidContext(this).build()
    //        }
}

}`

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 10, 2017

Member

@jumadeveloper What do you see if you do ./gradlew clean build --stacktrace?

Member

greenrobot commented Jul 10, 2017

@jumadeveloper What do you see if you do ./gradlew clean build --stacktrace?

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 10, 2017

@greenrobot How do i run this? on my terminal or where?

@greenrobot How do i run this? on my terminal or where?

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 10, 2017

I am currently on a Windows machine, so cmd not terminal

I am currently on a Windows machine, so cmd not terminal

@LouisCAD

This comment has been minimized.

Show comment
Hide comment
@LouisCAD

LouisCAD Jul 10, 2017

@jumadeveloper Most gradle commands are platform agnostic, hence work on Windows cmd too. You also have access to it from the Terminal tool window in Android Studio

@jumadeveloper Most gradle commands are platform agnostic, hence work on Windows cmd too. You also have access to it from the Terminal tool window in Android Studio

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 10, 2017

Member

@jumadeveloper cmd is fine, go to your project dir, and run gradlew clean build --stacktrace

Member

greenrobot commented Jul 10, 2017

@jumadeveloper cmd is fine, go to your project dir, and run gradlew clean build --stacktrace

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 10, 2017

@LouisCAD Thanks, just learnt that now

@LouisCAD Thanks, just learnt that now

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 10, 2017

@greenrobot
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
    at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
    at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
    at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:8)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.processCompilerExitCode(Tasks.kt:291)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:265)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:168)
    at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:147)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
    ... 70 more

BUILD FAILED

Total time: 4 mins 12.808 secs

@greenrobot
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
    at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
    at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
    at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:8)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.processCompilerExitCode(Tasks.kt:291)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:265)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:168)
    at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:147)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
    ... 70 more

BUILD FAILED

Total time: 4 mins 12.808 secs

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 10, 2017

Member

@jumadeveloper It might be a standard compilation error. Caused by: org.gradle.api.GradleException: Compilation error. See log for more details hints at that. Please run again without --stacktrace and check for compilation errors other than Unresolved reference: MyObjectBox.

Member

greenrobot commented Jul 10, 2017

@jumadeveloper It might be a standard compilation error. Caused by: org.gradle.api.GradleException: Compilation error. See log for more details hints at that. Please run again without --stacktrace and check for compilation errors other than Unresolved reference: MyObjectBox.

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 10, 2017

@greenrobot This is the result D:\Dev\Android\KotlinRetrofitObjectBox\app\src\main\java\com\androidstudy\kotlinretrofitobjectbox\App.kt: (33, 20): Unresolved reference: MyObjectBox
:app:compileDebugKotlin FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 18.78 secs

@greenrobot This is the result D:\Dev\Android\KotlinRetrofitObjectBox\app\src\main\java\com\androidstudy\kotlinretrofitobjectbox\App.kt: (33, 20): Unresolved reference: MyObjectBox
:app:compileDebugKotlin FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 18.78 secs

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 11, 2017

Member

@jumadeveloper After the build, what do you see in the build folder in the path "build/generated/kapt/debug"? Do you see any generated Java source files like MyObjectBox(.java)?

Member

greenrobot commented Jul 11, 2017

@jumadeveloper After the build, what do you see in the build folder in the path "build/generated/kapt/debug"? Do you see any generated Java source files like MyObjectBox(.java)?

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 11, 2017

@greenrobot There is no generated folder inside the build folder, the one outside the app directory. It is however present inside the build folder inside the app directory but has no kapt folder

@greenrobot There is no generated folder inside the build folder, the one outside the app directory. It is however present inside the build folder inside the app directory but has no kapt folder

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 11, 2017

Member

@jumadeveloper It might be that you applied the ObjectBox Gradle plugin to your top level Gradle project. It should be applied to the app level project where your entities are. We just updated the docs to be more clear on this: http://objectbox.io/documentation/kotlin/ Hope that helps.

Member

greenrobot commented Jul 11, 2017

@jumadeveloper It might be that you applied the ObjectBox Gradle plugin to your top level Gradle project. It should be applied to the app level project where your entities are. We just updated the docs to be more clear on this: http://objectbox.io/documentation/kotlin/ Hope that helps.

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 11, 2017

@greenrobot Lemmi have a look at the docs, then try it again.

@greenrobot Lemmi have a look at the docs, then try it again.

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 11, 2017

I have matched my gradle with your documentation, still getting the same error. I'll probably try this with another machine and see if it works

I have matched my gradle with your documentation, still getting the same error. I'll probably try this with another machine and see if it works

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 11, 2017

Member

@jumadeveloper If you want to put your gradle files somewhere (e.g. do a gist), I'm happy to have a look too.

Member

greenrobot commented Jul 11, 2017

@jumadeveloper If you want to put your gradle files somewhere (e.g. do a gist), I'm happy to have a look too.

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 12, 2017

Member

@jumadeveloper Using your code we could reproduce the issue. This line was missing in the app Gradle file:
apply plugin: 'kotlin-kapt'

Without that line, kapt1 is used which may or may not work - for our test projects it worked. That line enables kapt3, which fixes issues like that.

You can also check 0.9.13-RC3, which should become 0.9.13 later today.

Thanks for working on that issue!

Member

greenrobot commented Jul 12, 2017

@jumadeveloper Using your code we could reproduce the issue. This line was missing in the app Gradle file:
apply plugin: 'kotlin-kapt'

Without that line, kapt1 is used which may or may not work - for our test projects it worked. That line enables kapt3, which fixes issues like that.

You can also check 0.9.13-RC3, which should become 0.9.13 later today.

Thanks for working on that issue!

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 12, 2017

Thanks a lot, Appreciated. When is version one expected to be released?

Thanks a lot, Appreciated. When is version one expected to be released?

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 12, 2017

And one question, why is it that i can not use a variable _id yet Objectbox uses id?

And one question, why is it that i can not use a variable _id yet Objectbox uses id?

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 12, 2017

Member

@jumadeveloper do you have an example to help me understand your question?

Member

greenrobot commented Jul 12, 2017

@jumadeveloper do you have an example to help me understand your question?

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 12, 2017

@greenrobot I got some error a while back when using _id as an Entity. Let me try use the version RC3 and see if get any error

@greenrobot I got some error a while back when using _id as an Entity. Let me try use the version RC3 and see if get any error

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 12, 2017

@greenrobot It works now, perfectly well. Thanks!

@greenrobot It works now, perfectly well. Thanks!

@greenrobot greenrobot closed this Jul 12, 2017

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 13, 2017

Member

PS.: Here's the announcement post

Member

greenrobot commented Jul 13, 2017

PS.: Here's the announcement post

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 13, 2017

@greenrobot Thanks, just checked it out. I will be writting an article about it sometime today in my blog, make sure to check it out. Thanks

@greenrobot Thanks, just checked it out. I will be writting an article about it sometime today in my blog, make sure to check it out. Thanks

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 18, 2017

@greenrobot Does objectbox have a maximum limit? Or when does it log Database Full, and what could be the reason? Because it appears on some phones

@greenrobot Does objectbox have a maximum limit? Or when does it log Database Full, and what could be the reason? Because it appears on some phones

@greenrobot

This comment has been minimized.

Show comment
Hide comment
@greenrobot

greenrobot Jul 18, 2017

Member

@jumadeveloper Thanks for sharing your first article on ObjectBox. Ping us if you continue with the second, we're happy to have a look. Yes, there is a maximum size, which is 512 MB. This is a precaution to avoid the disk being flooded when your app is misbehaving. If you need more space, check out BoxStoreBuilder.maxSizeInKByte(long).

Member

greenrobot commented Jul 18, 2017

@jumadeveloper Thanks for sharing your first article on ObjectBox. Ping us if you continue with the second, we're happy to have a look. Yes, there is a maximum size, which is 512 MB. This is a precaution to avoid the disk being flooded when your app is misbehaving. If you need more space, check out BoxStoreBuilder.maxSizeInKByte(long).

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Jul 19, 2017

@greenrobot Thanks, I will be writting it later today. Appreciated

@greenrobot Thanks, I will be writting it later today. Appreciated

@sadeqzadeh

This comment has been minimized.

Show comment
Hide comment
@sadeqzadeh

sadeqzadeh Sep 26, 2017

Hey @greenrobot Thanks for the great work! I stumbled upon the same issue (MyObjectBox not resolved), and I seem to have got everything right. Have added the repositories in the top-level project and applied the plugin (after applying kotlin-kapt plugin) and added the dependencies (both compile and annotation processing stage - kapt) to the app module. I also tried adding the generated directory to the projects's source sets: main.java.srcDirs += 'build/generated/source/objectbox', but no effect. I was afraid that Proguard is removing the generated class, but tried adding an explicit keep rule, with no effect again. Any ideas?

Here is the stacktrace:

:app:clean :sdk:clean :app:objectboxPrepareBuild :app:preBuild :app:extractProguardFiles :app:preDebugBuild :app:checkDebugManifest :app:preReleaseBuild :app:preStagingBuild :app:prepareComAndroidSupportAnimatedVectorDrawable2531Library :app:prepareComAndroidSupportAppcompatV72531Library :app:prepareComAndroidSupportCardviewV72531Library :app:prepareComAndroidSupportDesign2531Library :app:prepareComAndroidSupportGridlayoutV72531Library :app:prepareComAndroidSupportPercent2531Library :app:prepareComAndroidSupportRecyclerviewV72531Library :app:prepareComAndroidSupportSupportCompat2531Library :app:prepareComAndroidSupportSupportCoreUi2531Library :app:prepareComAndroidSupportSupportCoreUtils2531Library :app:prepareComAndroidSupportSupportFragment2531Library :app:prepareComAndroidSupportSupportMediaCompat2531Library :app:prepareComAndroidSupportSupportV42531Library :app:prepareComAndroidSupportSupportVectorDrawable2531Library :app:prepareComAndroidSupportTransition2531Library :app:prepareComBraintreepaymentsApiBraintree253Library :app:prepareComBraintreepaymentsApiCore253Library :app:prepareComBraintreepaymentsBrowserSwitch013Library :app:prepareComGoogleAndroidGmsPlayServicesAnalytics1102Library :app:prepareComGoogleAndroidGmsPlayServicesBase1102Library :app:prepareComGoogleAndroidGmsPlayServicesBasement1102Library :app:prepareComGoogleAndroidGmsPlayServicesLocation1102Library :app:prepareComGoogleAndroidGmsPlayServicesMaps1102Library :app:prepareComGoogleAndroidGmsPlayServicesPlaces1102Library :app:prepareComGoogleAndroidGmsPlayServicesTasks1102Library :app:prepareComGoogleFirebaseFirebaseAnalytics1102Library :app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1102Library :app:prepareComGoogleFirebaseFirebaseCommon1102Library :app:prepareComGoogleFirebaseFirebaseConfig1102Library :app:prepareComGoogleFirebaseFirebaseCore1102Library :app:prepareComGoogleFirebaseFirebaseIid1102Library :app:prepareComGoogleFirebaseFirebaseMessaging1102Library :app:prepareComGoogleMapsAndroidAndroidMapsUtils043Library :app:prepareComJakewhartonButterknife801Library :app:prepareComJakewhartonTimberTimber451Library :app:prepareComMcxiaokeViewpagerindicatorLibrary241Library :app:prepareComMixpanelAndroidMixpanelAndroid487Library :app:prepareComOrhanobutLogger115Library :app:prepareComOrhanobutTracklyticsTracklyticsRuntime200Library :app:prepareComPaypalAndroidSdkPaypalOneTouch253Library :app:prepareComSquareupLeakcanaryLeakcanaryAndroid15Library :app:prepareComSquareupPicassoPicasso300SNAPSHOTLibrary :app:prepareComWdullaerMaterialdatetimepicker230Library :app:preDebugAndroidTestBuild :app:preDebugUnitTestBuild :app:preReleaseUnitTestBuild :app:preStagingUnitTestBuild :app:prepareIoMironovSmugglerSmugglerRuntime01213Library :app:prepareIoObjectboxObjectboxAndroid101Library :app:prepareIoReactivexRxandroid120Library :app:prepareMeZhanghaiAndroidMaterialprogressbarLibrary115Library :sdk:compileKotlin Using Kotlin incremental compilation :sdk:compileJava Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. :sdk:copyMainKotlinClasses :sdk:compileRetrolambdaMain :sdk:processResources UP-TO-DATE :sdk:classes :sdk:jar :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :app:processDebugManifest :app:fabricGenerateResourcesDebug :app:generateDebugResValues :app:processDebugGoogleServices Parsing json file: /Users/me/dev/pepper/app/google-services.json :app:generateDebugResources :app:mergeDebugResources :app:processDebugResources :app:generateDebugSources :app:incrementalDebugJavaCompilationSafeguard :app:javaPreCompileDebug :app:kaptGenerateStubsDebugKotlin Using Kotlin incremental compilation :app:kaptDebugKotlin :app:compileDebugKotlin Using Kotlin incremental compilation e: /Users/me/dev/pepper/app/src/main/kotlin/com/foo/bar/DefaultApplication.kt: (38, 18): Unresolved reference: MyObjectBox :app:compileDebugKotlin FAILED

sadeqzadeh commented Sep 26, 2017

Hey @greenrobot Thanks for the great work! I stumbled upon the same issue (MyObjectBox not resolved), and I seem to have got everything right. Have added the repositories in the top-level project and applied the plugin (after applying kotlin-kapt plugin) and added the dependencies (both compile and annotation processing stage - kapt) to the app module. I also tried adding the generated directory to the projects's source sets: main.java.srcDirs += 'build/generated/source/objectbox', but no effect. I was afraid that Proguard is removing the generated class, but tried adding an explicit keep rule, with no effect again. Any ideas?

Here is the stacktrace:

:app:clean :sdk:clean :app:objectboxPrepareBuild :app:preBuild :app:extractProguardFiles :app:preDebugBuild :app:checkDebugManifest :app:preReleaseBuild :app:preStagingBuild :app:prepareComAndroidSupportAnimatedVectorDrawable2531Library :app:prepareComAndroidSupportAppcompatV72531Library :app:prepareComAndroidSupportCardviewV72531Library :app:prepareComAndroidSupportDesign2531Library :app:prepareComAndroidSupportGridlayoutV72531Library :app:prepareComAndroidSupportPercent2531Library :app:prepareComAndroidSupportRecyclerviewV72531Library :app:prepareComAndroidSupportSupportCompat2531Library :app:prepareComAndroidSupportSupportCoreUi2531Library :app:prepareComAndroidSupportSupportCoreUtils2531Library :app:prepareComAndroidSupportSupportFragment2531Library :app:prepareComAndroidSupportSupportMediaCompat2531Library :app:prepareComAndroidSupportSupportV42531Library :app:prepareComAndroidSupportSupportVectorDrawable2531Library :app:prepareComAndroidSupportTransition2531Library :app:prepareComBraintreepaymentsApiBraintree253Library :app:prepareComBraintreepaymentsApiCore253Library :app:prepareComBraintreepaymentsBrowserSwitch013Library :app:prepareComGoogleAndroidGmsPlayServicesAnalytics1102Library :app:prepareComGoogleAndroidGmsPlayServicesBase1102Library :app:prepareComGoogleAndroidGmsPlayServicesBasement1102Library :app:prepareComGoogleAndroidGmsPlayServicesLocation1102Library :app:prepareComGoogleAndroidGmsPlayServicesMaps1102Library :app:prepareComGoogleAndroidGmsPlayServicesPlaces1102Library :app:prepareComGoogleAndroidGmsPlayServicesTasks1102Library :app:prepareComGoogleFirebaseFirebaseAnalytics1102Library :app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1102Library :app:prepareComGoogleFirebaseFirebaseCommon1102Library :app:prepareComGoogleFirebaseFirebaseConfig1102Library :app:prepareComGoogleFirebaseFirebaseCore1102Library :app:prepareComGoogleFirebaseFirebaseIid1102Library :app:prepareComGoogleFirebaseFirebaseMessaging1102Library :app:prepareComGoogleMapsAndroidAndroidMapsUtils043Library :app:prepareComJakewhartonButterknife801Library :app:prepareComJakewhartonTimberTimber451Library :app:prepareComMcxiaokeViewpagerindicatorLibrary241Library :app:prepareComMixpanelAndroidMixpanelAndroid487Library :app:prepareComOrhanobutLogger115Library :app:prepareComOrhanobutTracklyticsTracklyticsRuntime200Library :app:prepareComPaypalAndroidSdkPaypalOneTouch253Library :app:prepareComSquareupLeakcanaryLeakcanaryAndroid15Library :app:prepareComSquareupPicassoPicasso300SNAPSHOTLibrary :app:prepareComWdullaerMaterialdatetimepicker230Library :app:preDebugAndroidTestBuild :app:preDebugUnitTestBuild :app:preReleaseUnitTestBuild :app:preStagingUnitTestBuild :app:prepareIoMironovSmugglerSmugglerRuntime01213Library :app:prepareIoObjectboxObjectboxAndroid101Library :app:prepareIoReactivexRxandroid120Library :app:prepareMeZhanghaiAndroidMaterialprogressbarLibrary115Library :sdk:compileKotlin Using Kotlin incremental compilation :sdk:compileJava Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. :sdk:copyMainKotlinClasses :sdk:compileRetrolambdaMain :sdk:processResources UP-TO-DATE :sdk:classes :sdk:jar :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:mergeDebugShaders :app:compileDebugShaders :app:generateDebugAssets :app:mergeDebugAssets :app:processDebugManifest :app:fabricGenerateResourcesDebug :app:generateDebugResValues :app:processDebugGoogleServices Parsing json file: /Users/me/dev/pepper/app/google-services.json :app:generateDebugResources :app:mergeDebugResources :app:processDebugResources :app:generateDebugSources :app:incrementalDebugJavaCompilationSafeguard :app:javaPreCompileDebug :app:kaptGenerateStubsDebugKotlin Using Kotlin incremental compilation :app:kaptDebugKotlin :app:compileDebugKotlin Using Kotlin incremental compilation e: /Users/me/dev/pepper/app/src/main/kotlin/com/foo/bar/DefaultApplication.kt: (38, 18): Unresolved reference: MyObjectBox :app:compileDebugKotlin FAILED

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Sep 26, 2017

@sadeqzadeh Hi there, which version of objectbox are you using?

@sadeqzadeh Hi there, which version of objectbox are you using?

@sadeqzadeh

This comment has been minimized.

Show comment
Hide comment
@sadeqzadeh

sadeqzadeh Sep 26, 2017

Hi @jumadeveloper I use 1.0.1

Hi @jumadeveloper I use 1.0.1

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Sep 26, 2017

@sadeqzadeh If you don't mind, I have done a tutorial on my blog, on how to set it up using Kotlin. You could check it out here http://androidstudy.com

@sadeqzadeh If you don't mind, I have done a tutorial on my blog, on how to set it up using Kotlin. You could check it out here http://androidstudy.com

@sadeqzadeh

This comment has been minimized.

Show comment
Hide comment
@sadeqzadeh

sadeqzadeh Sep 26, 2017

Thanks for your help @jumadeveloper but the sections related to your build script and initilization of your BoxStore in your Application class is missing in the tutorial.
Update: My bad, I can now see in another post that you initialize your boxStore using MyObjectBox class which is missing for me.

sadeqzadeh commented Sep 26, 2017

Thanks for your help @jumadeveloper but the sections related to your build script and initilization of your BoxStore in your Application class is missing in the tutorial.
Update: My bad, I can now see in another post that you initialize your boxStore using MyObjectBox class which is missing for me.

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Sep 26, 2017

@sadeqzadeh So have you managed to make it work?

@sadeqzadeh So have you managed to make it work?

@sadeqzadeh

This comment has been minimized.

Show comment
Hide comment
@sadeqzadeh

sadeqzadeh Sep 26, 2017

@jumadeveloper No, not so far. What I meant by "missing" was that MyObjectBox class is not generated in my project, so I cannot reference it

sadeqzadeh commented Sep 26, 2017

@jumadeveloper No, not so far. What I meant by "missing" was that MyObjectBox class is not generated in my project, so I cannot reference it

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Sep 26, 2017

@sadeqzadeh Have you created at least one model? With the @entity annotation? Then tried to Make Project in Android Studio?

@sadeqzadeh Have you created at least one model? With the @entity annotation? Then tried to Make Project in Android Studio?

@sadeqzadeh

This comment has been minimized.

Show comment
Hide comment
@sadeqzadeh

sadeqzadeh Sep 27, 2017

Yes, I have done so, but the issue still exists @jumadeveloper. For now, I will go with storing a serialized json in SharedPreferences

Yes, I have done so, but the issue still exists @jumadeveloper. For now, I will go with storing a serialized json in SharedPreferences

@jumaallan

This comment has been minimized.

Show comment
Hide comment
@jumaallan

jumaallan Sep 27, 2017

That is pretty akward @sadeqzadeh Create a gist and add your code there, or create a demo repo and push it there, so that I can try building the same code from my end, if you don't mind

That is pretty akward @sadeqzadeh Create a gist and add your code there, or create a demo repo and push it there, so that I can try building the same code from my end, if you don't mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment