question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get provider

See original GitHub issue

Hello, first of all, thanks you for your good work!

I just followed multiple times the installation guide, and I double-checked this by comparing to the testapp, I can’t start my application with RemotePreferences because of a problem with provider.

In Manifest.xml:

<provider android:authorities="com.myapp.test.preferences" android:name=".MyPreferenceProvider" android:exported="true" />

In Java/com.myapp.test folder, MyPreferenceProvider Class:

public class MyPreferenceProvider extends RemotePreferenceProvider { public MyPreferenceProvider() { super("com.myapp.test.preferences", new String[] {"test"}); } }

And when I compile it: java.lang.RuntimeException: Unable to get provider com.myapp.test.MyPreferenceProvider: java.lang.ClassNotFoundException: Didn't find class "com.myapp.test.MyPreferenceProvider" on path … blablabla

I’m sure that’s a easy fix but I can’t find on internet a solution for this particular problem with your library. If you need any other information, I can give it to you. Thanks you for helping me and have a good day!

EDIT: I think it’s comes from Xposed, i’m using the v90-beta3 and the first errors logs after ClassNotFoundException is at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:361)

Complete error: 2021-01-17 02:07:07.810 10188-10188/com.myapp.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapp.test, PID: 10188 java.lang.RuntimeException: Unable to get provider com.myapp.test.MyPreferenceProvider: java.lang.ClassNotFoundException: Didn't find class "com.myapp.test.MyPreferenceProvider" on path: DexPathList[[zip file "/data/app/com.myapp.test-uibVPddJ9zeWqq_LXlkdFg==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.test-uibVPddJ9zeWqq_LXlkdFg==/lib/x86, /system/lib, /system/vendor/lib]] at android.app.ActivityThread.installProvider(ActivityThread.java:6288) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5851) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5772) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:361) at android.app.ActivityThread.handleBindApplication(<Xposed>) at android.app.ActivityThread.-wrap1(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.testapp.test.MyPreferenceProvider" on path: DexPathList[[zip file "/data/app/com.testapp.test-uibVPddJ9zeWqq_LXlkdFg==/base.apk"],nativeLibraryDirectories=[/data/app/com.testapp.test-uibVPddJ9zeWqq_LXlkdFg==/lib/x86, /system/lib, /system/vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.app.ActivityThread.installProvider(ActivityThread.java:6273) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5851)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5772)  at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:361)  at android.app.ActivityThread.handleBindApplication(<Xposed>)  at android.app.ActivityThread.-wrap1(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)  at android.os.Handler.dispatchMessage(Handler.java:105)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6541)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108)  Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/crossbowffs/remotepreferences/RemotePreferenceProvider; at java.lang.VMClassLoader.findLoadedClass(Native Method) at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738) at java.lang.ClassLoader.loadClass(ClassLoader.java:363) ... 16 more Caused by: java.lang.ClassNotFoundException: Didn't find class "com.crossbowffs.remotepreferences.RemotePreferenceProvider" on path: DexPathList[[zip file "/data/app/com.testapp.test-uibVPddJ9zeWqq_LXlkdFg==/base.apk"],nativeLibraryDirectories=[/data/app/com.testapp.test-uibVPddJ9zeWqq_LXlkdFg==/lib/x86, /system/lib, /system/vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) ... 19 more

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
git360Flipcommented, Jan 17, 2021

Ok I just found it:

In my build.gradle (app) I was using this line:

compileOnly 'com.crossbowffs.remotepreferences:remotepreferences:0.7'

I just replace it by:

implementation 'com.crossbowffs.remotepreferences:remotepreferences:0.7'

Like I said i’m really a beginner at Android Development and Xposed and I didn’t know that we have to use implementation instead of compileOnly that I have to use for Xposed

Thanks you for your help, and for your useful library 😃

0reactions
apsuncommented, Jan 17, 2021

Ah, I didn’t realize the readme is still using the deprecated compile directive (rolls eyes)… Yeah compile translates to implementation, not compileOnly (who thought that was a good idea?!) Let me fix that, sorry about the confusion!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.RuntimeException: Unable to get provider
Try initializing your database in the ContentProvider's onCreate method ( if you are not already doing this). This can also cause that error...
Read more >
Unable to get provider · Issue #10 - GitHub
After building project and generate Content Provider I have error Package net.simonvt.schematic.utils does not exist [image: image] ...
Read more >
'Unable to get provider' exception when installing apk ...
My app has several content providers. All providers are registered in AndroidManifest.xml as needed. There is no mistake in the code nor in...
Read more >
Question - java.lang.RuntimeException: Unable to get provider
I implemented all Ids and everything, game is has been built on api 30. java.lang.RuntimeException: Unable to get provider com.google.android.
Read more >
Fatal Exception: java.lang.RuntimeException - Zendesk help
Fatal Exception: java.lang.RuntimeException : Unable to get provider com.zendesk.belvedere.BelvedereFileProvider.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found