Я безуспешно пытаюсь сгенерировать подписанный APK.Android - создать подписанный APK с Proguard
Моего proguard-rules.pro
файл:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames 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 *;
}
# ================ Google Play Services ================
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
# ======================================================
# ============ Corrige erros de compilação =============
-dontwarn android.support.**
-keeppackagenames org.jsoup.nodes
-dontwarn okio.**
# ======================================================
# ==== crashlytics ====
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
# =====================
Моей зависимость:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-ads:9.2.0'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.android.support:design:23.4.0'
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile 'org.jsoup:jsoup:1.9.2'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.github.curioustechizen.android-ago:library:1.3.2'
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile 'com.amitshekhar.android:android-networking:0.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
}
Ошибка сборки:
Error:Execution failed for task ':mobile:transformClassesAndResourcesWithProguardForRelease'.
> java.io.IOException: Please correct the above warnings first.
:mobile:transformClassesAndResourcesWithProguardForRelease FAILED
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Как-то вы помогли мне подумать – Josinaldo
ОК, в моем случае я решил поставить «-dontwarn com.squareup.okhttp. **» (lib Picasso) в файл «proguard-rules.pro» – Josinaldo
Можете ли вы построить подписанный APK без каких-либо побочных эффектов? –