I've turned on minifyEnabled in Gradle but having trouble getting it working with Ormlite.
Reading various support pages, I have this:
-keepattributes *DatabaseField*
-keepattributes *DatabaseTable*
-keepattributes *SerializedName*
-keep class com.j256.**
-keepclassmembers class com.j256.** { *; }
-keep enum com.j256.**
-keepclassmembers enum com.j256.** { *; }
-keep interface com.j256.**
-keepclassmembers interface com.j256.** { *; }
-keep @com.j256.ormlite.field.* public class *
# Keep the helper class and its constructor
-keep class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
-keepclassmembers class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper {
public <init>(android.content.Context);
}
# Keep the annotations
-keepattributes *Annotation*
# Keep all model classes that are used by OrmLite
# Also keep their field names and the constructor
-keep @com.j256.ormlite.table.DatabaseTable class * {
@com.j256.ormlite.field.DatabaseField <fields>;
@com.j256.ormlite.field.ForeignCollectionField <fields>;
# Add the ormlite field annotations that your model uses here
<init>();
}
-keepclassmembers class **DateTime {
<init>(long);
long getMillis();
}
-dontwarn com.j256.ormlite.android.**
-dontwarn com.j256.ormlite.logger.**
-dontwarn com.j256.ormlite.misc.**
-dontwarn javax.persistence.**
But I am still getting the error :
java.sql.SQLException: Could not find public constructor with ConnectionSource and optional Class parameters class UserDao. Missing static on class?
at com.j256.ormlite.dao.DaoManager.createDao(DaoManager.java:86)
at com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper.getDao(OrmLiteSqliteOpenHelper.java:299)
I've turned on minifyEnabled in Gradle but having trouble getting it working with Ormlite.
Reading various support pages, I have this:
But I am still getting the error :
What am I missing?