I've added an expansion file to my app that has been working fine until recently. Whenever any file in the expansion file is opened, the app crashes with a NullPointerException. However, this only happens when the app is downloaded from the Play Store or an APK outside of Eclipse. When the app is run from Eclipse there is no such problem and all the files in the expansion work fine. My stack trace is slightly unhelpful because it tells me the problem is from an unknown source.
11-29 16:23:29.477: E/AndroidRuntime(3839): FATAL EXCEPTION: main
11-29 16:23:29.477: E/AndroidRuntime(3839): Process: net.multieducator.telaviv, PID: 3839
11-29 16:23:29.477: E/AndroidRuntime(3839): java.lang.NullPointerException
11-29 16:23:29.477: E/AndroidRuntime(3839): at net.multieducator.telaviv.be.onCreateView(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.support.v4.app.Fragment.performCreateView(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.support.v4.app.BackStackRecord.run(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.support.v4.app.FragmentManagerImpl.execPendingActions(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.support.v4.app.FragmentManagerImpl$1.run(Unknown Source)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.os.Handler.handleCallback(Handler.java:733)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.os.Handler.dispatchMessage(Handler.java:95)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.os.Looper.loop(Looper.java:136)
11-29 16:23:29.477: E/AndroidRuntime(3839): at android.app.ActivityThread.main(ActivityThread.java:5017)
11-29 16:23:29.477: E/AndroidRuntime(3839): at java.lang.reflect.Method.invokeNative(Native Method)
11-29 16:23:29.477: E/AndroidRuntime(3839): at java.lang.reflect.Method.invoke(Method.java:515)
11-29 16:23:29.477: E/AndroidRuntime(3839): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
11-29 16:23:29.477: E/AndroidRuntime(3839): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
11-29 16:23:29.477: E/AndroidRuntime(3839): at dalvik.system.NativeStart.main(Native Method)
Thanks for any help :)
You don't say whether you are using ProGuard in the release build but the difference in stability is consistent with issues I've had with it.
If your expansion file references classes in the main project, ProGuard's minifyenabled option may have obfuscated their names. If those names don't match up with the expansion file's expectations, a NullPointerException could occur.
Things to try:
Set minifyenabled to false and build again
If this results in a working version, add -keep class <your classes' package name>.** { *; } to the proguard-rules.pro file so that ProGuard will not obfuscate the class and member names in that package.
To build a development version that uses ProGuard in the the same manner as a release, in the build.gradle file copy release (under buildTypes) and call it debug.
Related
I have added the above crashlytics library in the AndroidStudio project, but its getting the below error
FATAL EXCEPTION: main
Process: com.pw.health.live_patient, PID: 28520
java.lang.NoClassDefFoundError: com.po.dm.input.DeviceType
at com.po.sdk.NWFactory.initDeviceInfo(NWFactory.java:293)
at com.po.sdk.NWFactory.access$500(NWFactory.java:79)
at com.po.sdk.NWFactory$2.receiveResponseData(NWFactory.java:267)
at com.po.sdk.http.handler.impl.RequestExecutor.onPostExecute(RequestExecutor.java:128)
at com.po.sdk.http.handler.impl.RequestExecutor.onPostExecute(RequestExecutor.java:29)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
12-16 12:37:25.478 28520-28555/com.pw.health.live_patient I/CrashlyticsCore: Crashlytics report upload complete: 5856754392F0-0001-6F68-9E8808E56C06
Refer This it is working fine for me
https://fabric.io/kits/android/crashlytics/install
i am having a problem dealing with this error, when i run my app it stops and shows error in logcat:
Caused by: java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.os.BuildCompat" on path: DexPathList[[zip file
"/data/app/homeseek.app.android.capstonehomeseek-2/base.apk"],nativeLibraryDirectories=[/data/app/homeseek.app.android.capstonehomeseek-2/lib/arm64,
/vendor/lib64, /system/lib64]]
full error:
FATAL EXCEPTION: main 11-29 13:00:24.538 1919-1919/? E/AndroidRuntime:
Process: homeseek.app.android.capstonehomeseek, PID: 1919 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime:
java.lang.NoClassDefFoundError: Failed resolution of:
Landroid/support/v4/os/BuildCompat; 11-29 13:00:24.538 1919-1919/?
E/AndroidRuntime: at
android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:188)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
homeseek.app.android.capstonehomeseek.MainActivity.onCreate(MainActivity.java:48)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.Activity.performCreate(Activity.java:6323) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.access$900(ActivityThread.java:153) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.os.Handler.dispatchMessage(Handler.java:102) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.os.Looper.loop(Looper.java:148) 11-29 13:00:24.538 1919-1919/?
E/AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:5451) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.reflect.Method.invoke(Native Method) 11-29 13:00:24.538
1919-1919/? E/AndroidRuntime: at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: Caused by:
java.lang.ClassNotFoundException: Didn't find class
"android.support.v4.os.BuildCompat" on path: DexPathList[[zip file
"/data/app/homeseek.app.android.capstonehomeseek-1/base.apk"],nativeLibraryDirectories=[/data/app/homeseek.app.android.capstonehomeseek-1/lib/arm64,
/vendor/lib64, /system/lib64]] 11-29 13:00:24.538 1919-1919/?
E/AndroidRuntime: at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.ClassLoader.loadClass(ClassLoader.java:511) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.ClassLoader.loadClass(ClassLoader.java:469) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:188)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
homeseek.app.android.capstonehomeseek.MainActivity.onCreate(MainActivity.java:48)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.Activity.performCreate(Activity.java:6323) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.access$900(ActivityThread.java:153) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.os.Handler.dispatchMessage(Handler.java:102) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
android.os.Looper.loop(Looper.java:148) 11-29 13:00:24.538
1919-1919/? E/AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:5451) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.reflect.Method.invoke(Native Method) 11-29 13:00:24.538
1919-1919/? E/AndroidRuntime: at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: Suppressed:
java.lang.ClassNotFoundException: android.support.v4.os.BuildCompat
11-29 13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.Class.classForName(Native Method) 11-29 13:00:24.538
1919-1919/? E/AndroidRuntime: at
java.lang.BootClassLoader.findClass(ClassLoader.java:781) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.BootClassLoader.loadClass(ClassLoader.java:841) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: at
java.lang.ClassLoader.loadClass(ClassLoader.java:504) 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: ... 18 more 11-29
13:00:24.538 1919-1919/? E/AndroidRuntime: Caused by:
java.lang.NoClassDefFoundError: Class not found using the boot class
loader; no stack trace available
here's my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "homeseek.app.android.capstonehomeseek"
minSdkVersion 20
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/PhotoUtil.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:palette-v7:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile ('com.android.support:support-v4:23.4.0'){
force = true;
}
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
i really have no idea how to fix this please help me
I faced with this proplem .And I think problem is :
compile 'com.google.android.gms:play-services:9.8.0'
You complile with may packages .In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit . So this make NoClassDefFoundError .
Follow this my post: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap
very much stuck here I had the project working fine now for some reason every time i launch i get a crash. any help on this would be appreciated.
Process: com.amr, PID: 4185
java.lang.UnsatisfiedLinkError: Couldn't load amr_android from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.amr-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.amr-1, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.amr.RandomRumbers.<clinit>(RandomRumbers.java:25)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
This is because in the apk there is no native library for the specific processor type of the target device. You should check which one you have and provide the apk with the native library compiled for that type.
My app run very good when built test but when build it with keystore and run my app it force close and show error
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException
at tuannt.appweather.f.f.a(Unknown Source)
at tuannt.appweather.e.a.a(Unknown Source)
at tuannt.appweather.e.a.onPostExecute(Unknown Source)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5162)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:744)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
What happened with my apk?
I recently started using proguard in my project.
I created test crash (in App class)
I received next error -
03-23 10:12:26.030 4956-4956/social.game.dating E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException
at social.game.dating.App.App.m(Unknown Source)
at social.game.dating.App.App.l(Unknown Source)
at social.game.dating.App.App$a.a(Unknown Source)
at social.game.dating.App.App$a.onPostExecute(Unknown Source)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
I run script
java -jar retrace.jar -verbose d:/mapping.txt d:/obf.txt > d:/fixed.txt
to obfuskate code, and receive next:
03-23 10:12:26.030 4956-4956/social.game.dating E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException
at social.game.dating.App.App.void initSync()(Unknown Source)
at social.game.dating.App.App.void access$100()(Unknown Source)
at social.game.dating.App.App$InitTask.java.lang.Void doInBackground(java.lang.Void[])(Unknown Source)
void onPostExecute(java.lang.Void)
at social.game.dating.App.App$InitTask.void onPostExecute(java.lang.Object)(Unknown Source)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
So I just received method, in wich exception was caught. I would like to get the line, if it is possible, please help!
PS also, I tried
retrace.bat -verbose d:/mapping.txt d:/obf.txt > d:/out.txt
and received the same result
You need to add next rule to proguard config file:
-keepattributes SourceFile,LineNumberTable
If you want to hide actual source file name add next rule:
-renamesourcefileattribute SomeName
and all file names will be renamed to SomeName.java, but after deobfuscation you will have class name and line number which will allow you to restore actual line of code