java - Android - app crashes when using a signed APK -
i trying signed apk android app. app works when install through android studio when generate signed apk , install app using apk following exception. idea on going on?
java.lang.runtimeexception: unable start activity componentinfo{com.app.test/com.app.test.activities.menuactivity}: java.lang.nullpointerexception: attempt invoke virtual method 'boolean java.lang.string.equalsignorecase(java.lang.string)' on null object reference @ android.app.activitythread.performlaunchactivity(activitythread.java:2358) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2420) @ android.app.activitythread.access$900(activitythread.java:154) @ android.app.activitythread$h.handlemessage(activitythread.java:1321) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5292) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:904) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:699) caused by: java.lang.nullpointerexception: attempt invoke virtual method 'boolean java.lang.string.equalsignorecase(java.lang.string)' on null object reference @ com.app.test.h.a.e(unknown source) @ com.app.test.activities.menuactivity.a(unknown source) @ com.app.test.activities.menuactivity.oncreate(unknown source) @ android.app.activity.performcreate(activity.java:5990) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1106) @ android.app.activitythread.performlaunchactivity(activitythread.java:2311) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2420) at android.app.activitythread.access$900(activitythread.java:154) at android.app.activitythread$h.handlemessage(activitythread.java:1321) at android.os.handler.dispatchmessage(handler.java:102) at android.os.looper.loop(looper.java:135) at android.app.activitythread.main(activitythread.java:5292) at java.lang.reflect.method.invoke(native method) at java.lang.reflect.method.invoke(method.java:372) at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:904) at com.android.internal.os.zygoteinit.main(zygoteinit.java:699)
this gradle build file looks like
buildscript { } apply plugin: 'com.android.application' android { compilesdkversion 21 buildtoolsversion "21.1.2" // installed in sdk manager defaultconfig { applicationid "com.app.test" minsdkversion 17 targetsdkversion 21 versioncode 1 versionname "1.0" multidexenabled true } buildtypes { release { minifyenabled true proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { mavencentral() flatdir { dirs 'libs' } maven { url 'http://maven.livotovlabs.pro/content/groups/public' } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:support-v4:21.0.3' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.google.code.gson:gson:2.3.1' compile 'com.squareup.okhttp:okhttp:2.5.0' compile 'com.squareup.picasso:picasso:2.5.2' }
you using proguard , have enables setting minifyenabled true.
buildtypes { release { minifyenabled true proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } }
if dont want use make minifyenabled false. otherwise read how use proguard http://developer.android.com/tools/help/proguard.html here discards class files , other resource not added in proguard-rules.pro.
Comments
Post a Comment