在 Android 上使用 OrmLite 进行 Proguard [英] Proguard with OrmLite on Android
问题描述
我应该如何在 Android 上使用带有 ormlite 库的 proguard?
How should I use proguard with ormlite library on Android?
试试这个:
-keep class com.j256.**
-keepclassmembers class com.j256.**
-keep enum com.j256.**
-keepclassmembers enum com.j256.**
-keep interface com.j256.**
-keepclassmembers interface com.j256.**
但我明白了:
03-23 20:23:54.518: E/AndroidRuntime(3032): java.lang.RuntimeException: 无法启动活动组件信息{cz.eman.android.cepro/cz.eman.android.cepro.activity.StationsOverviewActivity}: java.lang.IllegalStateException: 找不到为辅助类类 kb 接受 Context 参数的构造函数
03-23 20:23:54.518: E/AndroidRuntime(3032): java.lang.RuntimeException: Unable to start activity ComponentInfo{cz.eman.android.cepro/cz.eman.android.cepro.activity.StationsOverviewActivity}: java.lang.IllegalStateException: Could not find constructor that takes a Context argument for helper class class kb
我也尝试添加:
-keepclassmembers class * { public <init>(android.content.Context); }
但我收到了另一个班级成员的错误.
But I get another classmembers errors.
推荐答案
非常感谢您发布这样的帖子,帮助我们一步步前进.
Thank you a lot for posts like this that help us to advance step by step.
在尝试了最后一个但没有成功后,我想出了其他解决方案:
I've came up with other solution after i have tried the last one without success:
# OrmLite uses reflection
-keep class com.j256.**
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
-keepclassmembers enum com.j256.** { *; }
-keep interface com.j256.**
-keepclassmembers interface com.j256.** { *; }
我希望它可以帮助某人.
I hope it can help someone.
这篇关于在 Android 上使用 OrmLite 进行 Proguard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!