Unable to get provider com.crashlytics.android.CrashlyticsInitProvider java.lang.ClassNotFoundException - android

hello I use fabric for the crash but I'm having problems with Android below 5
error :
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to get provider com.crashlytics.android.CrashlyticsInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.crashlytics.android.CrashlyticsInitProvider" on path: DexPathList[[zip file "/data/app/ir.adp.picassoapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/ir.adp.picassoapp-2, /vendor/lib, /system/lib, /data/datalib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5184)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4733)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4666)
at android.app.ActivityThread.access$1300(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1439)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5455)
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:966)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:733)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.crashlytics.android.CrashlyticsInitProvider" on path: DexPathList[[zip file "/data/app/ir.adp.picassoapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/ir.adp.picassoapp-2, /vendor/lib, /system/lib, /data/datalib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.ActivityThread.installProvider(ActivityThread.java:5169)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4733) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4666) 
at android.app.ActivityThread.access$1300(ActivityThread.java:166) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1439) 
at android.os.Handler.dispatchMessage(Handler.java:107) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5455) 
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:966) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:733) 
at dalvik.system.NativeStart.main(Native Method) 
Please help me

Enable multidex
for devices with Android API prior to 21,
Include the multidex library :
implementation 'com.android.support:multidex:1.0.2'
and extend MultiDexApplication in your Application class

Add multidex library into your app build Gradle and enabled multiDex true in defaultConfig
compile 'com.android.support:multidex:1.0.1'

Related

com.iceteck.silicompressorr.provider.GenericFileProvider doesn't found and crash app

When I install app on the device with the android 4.4 app crashed and I get this error in the logcat.
But app installs and correctly work on the above android.
How can I fix this error
I also add the below code on the manifiests.xml and didn't get any result
<provider
android:name="com.iceteck.silicompressorr.provider.GenericFileProvider"
android:authorities="${applicationId}.silli.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
Error:
java.lang.RuntimeException: Unable to get provider com.iceteck.silicompressorr.provider.GenericFileProvider: java.lang.ClassNotFoundException: Didn't find class "com.iceteck.silicompressorr.provider.GenericFileProvider" on path: DexPathList[[zip file "/data/app/ir.mspars.azmoun-9.apk"],nativeLibraryDirectories=[/data/app-lib/ir.mspars.azmoun-9, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5131)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4722)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4605)
at android.app.ActivityThread.access$1600(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1341)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5511)
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:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.iceteck.silicompressorr.provider.GenericFileProvider" on path: DexPathList[[zip file "/data/app/ir.mspars.azmoun-9.apk"],nativeLibraryDirectories=[/data/app-lib/ir.mspars.azmoun-9, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.ActivityThread.installProvider(ActivityThread.java:5116)
you may have not selected the lowest Android version when you are creating a new project.
if this is the problem try this
https://www.youtube.com/watch?v=D5lRTCaqhII&ab_channel=CodeDocu_com

Android app crashes with ClassNotFoundException on some devices

Hi I am developing andorid applicaiton.I tried to install this application on some devices. It works fine.But on some other devices it crashes with following exception:
07-13 12:28:17.515 17306-17306/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.simple, PID: 17306
java.lang.RuntimeException: Unable to instantiate application
com.example.simple.SampleApplication: java.lang.ClassNotFoundException:
Didn't find class "com.example.simple.SampleApplication" on path:
DexPathList[[zip file
"/data/app/com.example.simple-1/base.apk"],nativeLibraryDirectories=[/data/ap
p/com.example.simple-1/lib/arm,
/data/app/com.example.simple-1/base.apk!/lib/armeabi-v7a, /vendor/lib,
/system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:608)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5013
)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5847)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.jav
a:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.example.simple.SampleApplication" on path: DexPathList[[zip file
"/data/app/com.example.simple-1/base.apk"],nativeLibraryDirectories=[/data/a
pp/com.example.simple-1/lib/arm,
/data/app/com.example.simple-1/base.apk!/lib/armeabi-v7a, /vendor/lib,
/system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:986)
at android.app.LoadedApk.makeApplication(LoadedApk.java:603)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5013
) 
at android.app.ActivityThread.-wrap1(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5847) 
at java.lang.reflect.Method.invoke(Native Method) 
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.jav
a:865) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
Suppressed: java.lang.ClassNotFoundException:
com.example.simple.SampleApplication
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot
class loader; no stack trace available
07-13 12:33:17.714 17306-17306/com.example.simple I/RuntimeInit: RuntimeInit: enable FTRACE
I already enabled multiDexEnabled truein my gradle. Need some help to resolve this problem. Thank you.
Add below link under dependencies tag :
compile 'com.android.support:multidex:1.0.1'
Sync and run...
In build.gradle file
dependencies {
...
//Multi Dex
compile 'com.android.support:multidex:1.0.1'
....
}
In sample application class
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(SampleApplication.this);
}
then clean & build project
compile 'com.android.support:multidex:1.0.1'
worked for me...
am trying to run application from mac ( was build on windows ).
It crashes on app launches.
Thanks all..

java.lang.ClassNotFoundException: Didn't find class ".MyApplication" on path: DexPathList[[zip file "/data/app/com.sampledemo.box8demo-1/base.apk"]

I have been trying to solve below issue from 3 days.
Problem : Created new module as a library in android project and created aar file using assembleDebug.
That aar file i have added in another project as a new module ( dependecies also added ) but after installing the app into the device i am getting below error :
6055-26055/com.sampledemo.box8demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sampledemo.box8demo, PID: 26055
java.lang.RuntimeException: Unable to instantiate application com.NerdNow.NerdNowApplication: java.lang.ClassNotFoundException: Didn't find class "com.NerdNow.NerdNowApplication" on path: DexPathList[[zip file "/data/app/com.sampledemo.box8demo-1/base.apk"],nativeLibraryDirectories=[/data/app/com.sampledemo.box8demo-1/lib/arm64, /vendor/lib64, /system/lib64]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:580)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4699)
at android.app.ActivityThread.access$1600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.NerdNow.NerdNowApplication" on path: DexPathList[[zip file "/data/app/com.sampledemo.box8demo-1/base.apk"],nativeLibraryDirectories=[/data/app/com.sampledemo.box8demo-1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:982)
at android.app.LoadedApk.makeApplication(LoadedApk.java:575)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4699)
at android.app.ActivityThread.access$1600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Suppressed: java.lang.NoClassDefFoundError: com.NerdNow.NerdNowApplication
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:338)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 13 more
Suppressed: java.lang.ClassNotFoundException: com.NerdNow.NerdNowApplication
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
I have enabled multidex in gradle file as well as extended MultiDexApplication in Application class
Also added multidex dependecy in gradle file
please help me to resolve this issue.
Ok Guys, after many try i found that you can not add dependencies on aar files. you have to include jar for each dependencies.

java.lang.RuntimeException: Unable to instantiate application

In Google Play Developer Console I see this crash:
java.lang.RuntimeException: Unable to instantiate application com.example.MyApp: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApp" on path: DexPathList[[zip file "/mnt/asec/com.example.testapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.testapp-1/lib, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4545)
at android.app.ActivityThread.access$1500(ActivityThread.java:160)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5330)
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:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApp" on path: DexPathList[[zip file "/mnt/asec/com.example.testapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.testapp-1/lib, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
... 11 more
Suppressed: java.io.IOException: unable to open DEX file
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:296)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexFile.<init>(DexFile.java:59)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
at dalvik.system.DexPathList.<init>(DexPathList.java:112)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:57)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:326)
at android.app.LoadedApk.makeApplication(LoadedApk.java:508)
... 11 more
This crash occurs mostly on Android versions 4.4 and 4.2.
This answer suggests that this crash occurs when the apk is updated by dalvik. It seems to be a low-priority Android bug.
Are there any workarounds for this?
Does it help to set
<application
android:allowBackup="false"
in Manifest.xml?
(Maybe the backup of application is stored on SD-card, which is causing the problem on apk update).
This error usually occurs when you declare a class extending Application (android.app.Application) and then user android:name="thatClassName"
But if your App can't access it class fully. This error can occur
Try Making the class public only
It will make the application user that class globally

Android Studio - Unable to resolve class L after upgrade

I've recently upgraded my tools and build.gradle to version 21 in Android Studio.
My apk now crashes on load and I get the following error:
Unable to resolve superclass of Lcom/mypackage/MyClass;
Link of class 'Lcom/mypackage/MyClass
Is anyone experiencing similar issues?
I've tried the following but no success:
Cleaning the project
Restarting android studio
Re-importing the project
More log details:
java.lang.RuntimeException: Unable to instantiate application com.mypackage.MyClass:
java.lang.ClassNotFoundException: Didn't find class "com.mypackage.MyClass" on path:
DexPathList[[zip file "/data/app/com.mypackage-1.apk"],nativeLibraryDirectories=[/data/app-
lib/com.mypackage-1, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4301)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
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)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mypackage.MyClass" on path:
DexPathList[[zip file "/data/app/com.mypackage-1.apk"],nativeLibraryDirectories=[/data/app-
lib/com.mypackage-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
            
I later found out that this was an issue relating to multi dexing.
I needed to run a script to generate the names of the files for my main-dex-list
The blog post below has a detailed outline of this: http://blog.osom.info/2014/10/generating-main-dex-list-file.html

Categories

Resources