0

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>;
 }
Jon Goodwin
  • 9,053
  • 5
  • 35
  • 54
m7majidi
  • 83
  • 2
  • 7

1 Answers1

0

Its been a while since developing androis apps but check out this link im pretty sure it shows you how to change minimum device SDKVersions.

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    // Running on something older than API level 11, so disable
    // the drag/drop features that use ClipboardManager APIs
    disableDragAndDrop();
}

is an example of some code it explains...

Hope this helps.

Ollie Beumkes
  • 301
  • 2
  • 17
  • 1
    thank you for responding, but the minimum sdk is not the issue. as i mentioned everything works fine on build version but on release version app is not installing – m7majidi Feb 07 '18 at 22:32
  • Ah thank you for clarifying, I am not to sure of any more advice to give but I have found another good stack overflow link I wouldn't be supprised if you have seen it but if not here it is I hope you fix your problem :) https://stackoverflow.com/questions/4226132/app-not-installed-error-on-android – Ollie Beumkes Feb 07 '18 at 22:35