android - Error while generating signed apk -
i got old project , keystore file , when trying create signed apk give following error.
[2013-05-19 12:36:02 - xxxxxxx] proguard returned error code 1. see console [2013-05-19 12:36:02 - xxxxxxx] unable access jarfile /users/muhammadali/documents/development [2013-05-19 12:36:12 - xxxxxx] proguard returned error code 1. see console [2013-05-19 12:36:12 - xxxxxx] unable access jarfile /users/muhammadali/documents/development
please why cant generate apk file.
alright, few things:
make sure
proguard
version4.8
, above. there known bug caused in4.7.
assuming running latest version of proguard , still occuring, go
[android-sdk-folder]/sdk/tools/proguard/bin/proguard.sh
, make following changes:change:
java -jar $proguard_home/lib/proguard.jar "$@"
to:
java -jar "$proguard_home/lib/proguard.jar" "$@"
add line
project.properties
file in application folder.proguard.config=proguard.cfg
create
proguard.cfg
file in application folder.populate
proguard.cfg
file below (modify needed).-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>; } -keepclasseswithmembers class * { public <init>(android.content.context, android.util.attributeset); } -keepclasseswithmembers class * { public <init>(android.content.context, android.util.attributeset, int); } -keepclassmembers class * extends android.app.activity { public void *(android.view.view); public void onsearchbuttonclicked(java.lang.string); } -keepclassmembers enum * { public static **[] values(); public static ** valueof(java.lang.string); } -keep class * implements android.os.parcelable { public static final android.os.parcelable$creator *; }
turn
project -> build automatically
off go menuproject -> clean...
, clean project first.
good luck! i'll happy out try steps above , go through it.
Comments
Post a Comment