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
Proguard - Primary key field not found for model #10
Comments
@SahSantoshh Hi, you need add field with @PrimaryKey annotation |
Thank You @agaDeonix for your response but Following code solved my issue: |
I'm getting this error while applying proguard:
Any help? Full error: |
@HamzehSoboh try this Proguard rules:
|
After proguard rules this is error
my proguardrules:
#ReActiveAndroid
-keep class com.reactiveandroid.** { *; }
-keep class com.reactiveandroid.. { *; }
-keep class * extends com.reactiveandroid.Model
-keep class * extends com.reactiveandroid.serializer.TypeSerializer
-keepattributes Column
-keepattributes Table
-keepattributes PrimaryKey
-keepattributes Unique
-keepattributes Annotation
-keepclassmembers class * {
@fully.qualified.package.AnnotationType *;
}
E/CrashlyticsCore: Failed to execute task. java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:177) at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41) at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:320) at com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException(CrashlyticsController.java:300) at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:42) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) E/AndroidRuntime: FATAL EXCEPTION: main Process: np.com.sahsantosh.shareExpense, PID: 15633 java.lang.RuntimeException: Unable to create application np.com.sahsantosh.shareExpense.common.ApplicationClass: java.lang.IllegalStateException: Primary key field not found for model Category at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4973) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5765) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:683) Caused by: java.lang.IllegalStateException: Primary key field not found for model Category at com.reactiveandroid.internal.database.table.TableInfo.findPrimaryKeyField(TableInfo.java:187) at com.reactiveandroid.internal.database.table.TableInfo.<init>(TableInfo.java:70) at com.reactiveandroid.internal.database.DatabaseInfo.createTablesInfo(DatabaseInfo.java:153) at com.reactiveandroid.internal.database.DatabaseInfo.loadModels(DatabaseInfo.java:130) at com.reactiveandroid.internal.database.DatabaseInfo.<init>(DatabaseInfo.java:45) at com.reactiveandroid.ReActiveAndroid.init(ReActiveAndroid.java:53) at np.com.sahsantosh.shareExpense.common.ApplicationClass.onCreate(ApplicationClass.java:47) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1018) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4970) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5765) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:683)
The text was updated successfully, but these errors were encountered: