trbnb / MvvmBase

Apache License 2.0
15 stars 7 forks source link

Crash at startup when used with instant run #14

Closed BaN4NaJ0e closed 5 years ago

BaN4NaJ0e commented 5 years ago

App crashes at runtime with:

 java.lang.RuntimeException: Unable to create application de.appmotion.baseapp.app.App: java.lang.IllegalArgumentException: Not a primitive field: com.android.tools.ir.runtime.IncrementalChange de.appmotion.baseapp.BR.$change
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5923)
        at android.app.ActivityThread.access$1100(ActivityThread.java:202)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1665)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:198)
        at android.app.ActivityThread.main(ActivityThread.java:6729)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.IllegalArgumentException: Not a primitive field: com.android.tools.ir.runtime.IncrementalChange de.appmotion.baseapp.BR.$change
        at java.lang.reflect.Field.getInt(Native Method)
        at de.trbnb.mvvmbase.MvvmBase.retrieveFieldIds(MvvmBase.kt:39)
        at de.trbnb.mvvmbase.MvvmBase.init(MvvmBase.kt:18)
        at de.appmotion.baseapp.app.App.onCreate(App.kt:37)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1155)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5918)
trbnb commented 5 years ago

This is an issue that will happen with Instant Run enabled on 1.4.0. I've uploaded a hotfix version (1.4.1).