Today I noticed that my Android app does not install on pre-lolipop
devices when I build release apk (I tried both signed and unsigned apk).
I installed it on my Android 7
device and it was working fine but when I tested it on lolipop
and kitkat
devices I faced "App not installed." error when I tried to install the apk.
But if I build debug apk it installs successfully.
So I don't know where the problem is but I think maybe it has something to do with the proguard-rules
.
Here is my proguard-rules :
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
-keep class org.apache.harmony.awt.datatransfer.** { *; }
-keep class com.github.mikephil.charting.data.realm.base.** { *; }
-keep class com.github.mikephil.charting.data.realm.implementation.** { *; }
-keep class com.rey.material.** { *; }
-keep class com.rey.material.$ { *; }
-keep class com.parse.** { *; }
-keep class com.parse.interceptors { *; }
-keep class com.parse.interceptors.** { *; }
-keep class javax.** { *; }
-keep class okio.** { *; }
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-dontwarn android.support.**
-dontwarn org.**
-dontwarn com.**
-dontwarn javax.**
-dontwarn okio.**
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
#-keep class * implements android.os.Parcelable {
# public static final android.os.Parcelable$Creator *;
#}
-keepclassmembers class **.R$* {
public static <fields>;
}