JavaNoober / BackgroundLibrary

A framework for directly generating shape through Tags, no need to write shape.xml again(通过标签直接生成shape,无需再写shape.xml)
Apache License 2.0
3.86k stars 469 forks source link

dependencies Rxjava3, Unable to get provider error #101

Closed hebeiliang closed 4 years ago

hebeiliang commented 4 years ago

项目依赖 implementation "io.reactivex.rxjava3:rxjava:3.0.2" implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'

java.lang.RuntimeException: Unable to get provider com.noober.background.BackgroundContentProvider: java.lang.ClassNotFoundException: Didn't find class "com.noober.background.BackgroundContentProvider" on path: DexPathList[[zip file "/data/app/com.jsyh.game-0OslgIseG1Cs6HppR29Gtg==/base.apk"],nativeLibraryDirectories=[/data/app/com.jsyh.game-0OslgIseG1Cs6HppR29Gtg==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]] at android.app.ActivityThread.installProvider(ActivityThread.java:7215) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6699) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6600) at android.app.ActivityThread.-wrap2(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) at android.os.Handler.dispatchMessage(Handler.java:108) at android.os.Looper.loop(Looper.java:166) at android.app.ActivityThread.main(ActivityThread.java:7529) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

但是依赖Rxjava2 没有问题

JavaNoober commented 4 years ago

clean项目试一下,应该不是代码导致的问题

hebeiliang commented 4 years ago

clean项目试一下,应该不是代码导致的问题

从我目前测试的结果来看,可能手机问题.因为一直闪退的是华为P9(EMUI 8.0.0 , android 8.0.0),其他手机没有问题.

JavaNoober commented 4 years ago

可能是provider自动初始化导致的,需要的话我可以给你一个没有provider的版本,然后你自己在application里面加入inject代码

6cwong commented 4 years ago

我也遇到了这个问题,我在一部4.4.4的手机上发现会闪退,报错信息同上,很尴尬啊!求解决...

JavaNoober commented 4 years ago

@6cwong 加我的群,给你提供单独no provider版本

6cwong commented 4 years ago

@6cwong 加我的群,给你提供单独no provider版本

我发现是MultiDex引起的问题,我把 MultiDex.install(this);放在Application的onCreate中就会报上面的错,我把 MultiDex.install(this)放在attachBaseContext()中就不会报错。