objectbox / objectbox/objectbox-java

Support initialization magic (transformer) for plain Kotlin projects

オープン
#440 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@greenrobot-team がすでに取り組んでいます。

2018年4月30日 から。

enhancement help wanted
主要言語
Java
スター
4.6k
フォーク
311
PR マージ指標
30日以内にマージされた PR はありません

説明

Issue Basics

  • ObjectBox version (are using the latest version?): 1.5.0
  • Reproducibility: always

Reproducing the bug

Description

I want to extract a common module (all objectBox usage are here) from and Android app so that it can be used for TornatoFX app (Kotlin) as well.
When I set up the module as an Android library module, the Android app run fine but when I try to remove all the Android related stuff, gradle build produces logs like this:

Warning: cursor transformer did not find entity class org.de_studio.diary.appcore.data.objectBox.TodoOB

When I run the app, I can't put entity with ToMany relation into the box. I can't attach to the box as well:

java.lang.IllegalArgumentException: io.reactivex.exceptions.OnErrorNotImplementedException: lateinit property places has not been initialized

Seems like only entities with relation include in the logs.

I read the document, tried many way but can't get rid of the warning. Below is my module's settings.gradle file. Did I miss anything?

Code
apply plugin: 'java-library'
apply plugin: 'application'
apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'
apply plugin: 'net.ltgt.apt-idea'
apply plugin: 'io.objectbox'

kapt {
    arguments {
        arg("objectbox.debug", true)
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    api "io.reactivex.rxjava2:rxjava:2.1.1"
    api "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    api 'com.artemzin.rxjava:proguard-rules:1.2.10.0'
    api 'com.jakewharton.timber:timber:4.5.1'
    api 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
    api 'com.gojuno.koptional:koptional:1.2.0'
    api 'com.gojuno.koptional:koptional-rxjava2-extensions:1.2.0'
    api 'net.danlew:android.joda:2.9.9.1'
    api 'com.google.code.gson:gson:2.8.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    api "io.objectbox:objectbox-kotlin:$objectboxVersion"
    kapt "io.objectbox:objectbox-processor:$objectboxVersion"

    implementation "io.objectbox:objectbox-java:$objectboxVersion"
}

tasks.withType(JavaCompile) {
    options.compilerArgs += [ "-Aobjectbox.debug=true" ]
}

sourceSets {
    main {
        java {
            srcDir 'src/main/java'
            srcDir 'build/generated/source/kapt/main'
        }
    }
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

Please let me know if you need more information. I will make a sample project if needed.
Thanks!

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。