Closed greenrobot closed 7 years ago
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.
+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.
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.
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.
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... 🤖
@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.
And there also should be some fallback. Some plan B that works without the constructor.
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.
Hope this issue is resolved before ObjectBox leaves beta status
+1
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?
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!!
have tried the version 0.9.13-RC, however am getting this error, Error:(33, 20) Unresolved reference: MyObjectBox. How do I resolve this?
@jumadeveloper Did you try to build the projects first? This class is generated during build.
@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
I have retried, still not working. That's the only issue am getting : Unresolved reference: MyObjectBox.
@jumadeveloper Does this occur in Android Studio? Did you check building with gradlew?
There's a new version "0.9.13-RC2" with fixes for transient lists etc.
@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
/**
@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.kt
package com.androidstudy.kotlinretrofitobjectbox
/**
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()
// }
}
}`
@jumadeveloper What do you see if you do ./gradlew clean build --stacktrace
?
@greenrobot How do i run this? on my terminal or where?
I am currently on a Windows machine, so cmd not terminal
@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 cmd is fine, go to your project dir, and run gradlew clean build --stacktrace
@LouisCAD Thanks, just learnt that now
@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
@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
.
@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
@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)?
@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
@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.
@greenrobot Lemmi have a look at the docs, then try it again.
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
@jumadeveloper If you want to put your gradle files somewhere (e.g. do a gist), I'm happy to have a look too.
@greenrobot Sure, Kindly check them out
https://gist.github.com/jumadeveloper/f8797b5c3c7fb034b8021cb6f1acce2f
@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!
Thanks a lot, Appreciated. When is version one expected to be released?
And one question, why is it that i can not use a variable _id yet Objectbox uses id?
@jumadeveloper do you have an example to help me understand your question?
@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 It works now, perfectly well. Thanks!
PS.: Here's the announcement post
@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 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
@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).
@greenrobot Thanks, I will be writting it later today. Appreciated
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 Hi there, which version of objectbox are you using?
Hi @jumadeveloper I use 1.0.1
@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
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: