Issue with OkBuck and Realm

252 views Asked by At

My build and APK are successfully generated, but when I run the app an error is raised, forcing close the app. If I build the same dependencies with Gradle, not using OkBuck, it runs perfectly. Logcat:

E/AndroidRuntime( 3447): FATAL EXCEPTION: main
E/AndroidRuntime( 3447): Process: mobile.nonaka.com.nonakaapp.ci, PID: 3447
E/AndroidRuntime( 3447): java.lang.ExceptionInInitializerError: RealmTransformer doesn't seem to be applied. Please update the project configuration to use the Realm Gradle plugin. See https://realm.io/news/android-installation-change/
E/AndroidRuntime( 3447):    at io.realm.RealmConfiguration.<clinit>(RealmConfiguration.java:77)
E/AndroidRuntime( 3447):    at io.realm.RealmConfiguration$Builder.initializeBuilder(RealmConfiguration.java:428)
E/AndroidRuntime( 3447):    at io.realm.RealmConfiguration$Builder.<init>(RealmConfiguration.java:391)
E/AndroidRuntime( 3447):    at mobile.nonaka.com.nonakaapp.NONAKAApplication.onCreate(NONAKAApplication.java:44)
E/AndroidRuntime( 3447):    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime( 3447):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
E/AndroidRuntime( 3447):    at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime( 3447):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime( 3447):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3447):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 3447):    at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 3447):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3447):    at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3447):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 3447):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 3447):    at dalvik.system.NativeStart.main(Native Method)

NONAKAApplication.java line 44 has this code:

    RealmConfiguration realmConfiguration = new RealmConfiguration.Builder(this)
            .schemaVersion(1)
            .encryptionKey(realmKeyProvider.getRealmKey())
            .deleteRealmIfMigrationNeeded()
            .build();

https://realm.io/news/android-installation-change did not help. This is my Gradle configuration that I used to generate the Buck files:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "io.realm:realm-gradle-plugin:2.2.1"
    }
}

apply plugin: 'realm-android'

Versions:

OkBuck 0.13.1
Realm 2.2.1
Gradle 3.2
Android Gradle Plugin 2.2.3
Android Studio 2.2.3
minSdkVersion 18
targetSdkVersion 25
compileSdkVersion 25
buildToolsVersion '25.0.2'

Thanks a lot!

1

There are 1 answers

0
EpicPandaForce On BEST ANSWER

That's because OkBuck doesn't support the Transform API yet.

image