amazon web services - Android App Crashes After Proguard Obfuscation -
my app working fine without proguard obfuscation. if export proguard obfuscation , install apk file, crashing on first activity itself. using aws android sdk in app.
my proguard.txt file is
# configuration file proguard. # http://proguard.sourceforge.net/index.html#manual/usage.html -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose # optimization turned off default. dex not code run # through proguard optimize , preverify steps (and performs # of these optimizations on own). -dontoptimize -dontpreverify # note if want enable optimization, cannot # include optimization flags in own project configuration file; # instead need point # "proguard-android-optimize.txt" file instead of 1 # project.properties file. -keepattributes *annotation* -keep public class com.google.vending.licensing.ilicensingservice -keep public class com.android.vending.licensing.ilicensingservice # native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native <methods>; } # keep setters in views animations can still work. # see http://proguard.sourceforge.net/manual/examples.html#beans -keepclassmembers public class * extends android.view.view { void set*(***); *** get*(); } # want keep methods in activity used in xml attribute onclick -keepclassmembers class * extends android.app.activity { public void *(android.view.view); } # enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -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>; } # support library contains references newer platform versions. # don't warn in case app linking against older # platform version. know them, , safe. -dontwarn android.support.** #aws -keep class org.apache.commons.logging.** { *; } -keep class com.amazonaws.services.sqs.queueurlhandler { *; } -keep class com.amazonaws.javax.xml.transform.sax.* { public *; } -keep class com.amazonaws.javax.xml.stream.** { *; } -keep class com.amazonaws.services.**.model.*exception* { *; } -keep class org.codehaus.** { *; } -keepattributes signature,*annotation* -keep class com.amazonaws.** { *; } -dontwarn com.amazonaws.** -dontwarn javax.xml.stream.events.** -dontwarn org.codehaus.jackson.** -dontwarn org.apache.commons.logging.impl.** -dontwarn org.apache.http.conn.scheme.** -keep class com.fasterxml.jackson.**{*;} -dontwarn com.fasterxml.jackson.**
exception getting
03-10 11:05:24.552: e/androidruntime(12241): fatal exception: asynctask #1 03-10 11:05:24.552: e/androidruntime(12241): process: com.in.nc.amlooking4.android, pid: 12241 03-10 11:05:24.552: e/androidruntime(12241): java.lang.runtimeexception: error occured while executing doinbackground() 03-10 11:05:24.552: e/androidruntime(12241): @ android.os.asynctask$3.done(asynctask.java:300) 03-10 11:05:24.552: e/androidruntime(12241): @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:355) 03-10 11:05:24.552: e/androidruntime(12241): @ java.util.concurrent.futuretask.setexception(futuretask.java:222) 03-10 11:05:24.552: e/androidruntime(12241): @ java.util.concurrent.futuretask.run(futuretask.java:242) 03-10 11:05:24.552: e/androidruntime(12241): @ android.os.asynctask$serialexecutor$1.run(asynctask.java:231) 03-10 11:05:24.552: e/androidruntime(12241): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) 03-10 11:05:24.552: e/androidruntime(12241): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) 03-10 11:05:24.552: e/androidruntime(12241): @ java.lang.thread.run(thread.java:841) 03-10 11:05:24.552: e/androidruntime(12241): caused by: java.lang.nullpointerexception 03-10 11:05:24.552: e/androidruntime(12241): @ com.in.nc.amlooking4.android.a.d.<init>(unknown source) 03-10 11:05:24.552: e/androidruntime(12241): @ com.in.nc.amlooking4.android.a.b.b(unknown source) 03-10 11:05:24.552: e/androidruntime(12241): @ com.in.nc.amlooking4.android.a.b.a(unknown source) 03-10 11:05:24.552: e/androidruntime(12241): @ com.in.nc.amlooking4.android.f.a(unknown source) 03-10 11:05:24.552: e/androidruntime(12241): @ com.in.nc.amlooking4.android.f.doinbackground(unknown source) 03-10 11:05:24.552: e/androidruntime(12241): @ android.os.asynctask$2.call(asynctask.java:288) 03-10 11:05:24.552: e/androidruntime(12241): @ java.util.concurrent.futuretask.run(futuretask.java:237)
what issue?
as mentioned on your forum post, make sure awscredentials.properties file in package of primary activity before using proguard.
if not work, try changing using constants class instead of properties file.
Comments
Post a Comment