Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get provider com.iqiyi.qigsaw.sample.java.JavaContentProvider #52

Open
TongWeiLe opened this issue May 21, 2021 · 3 comments
Open

Comments

@TongWeiLe
Copy link

android 11demo 启动失败
2021-05-21 21:08:39.553 30745-30745/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.iqiyi.qigsaw.sample, PID: 30745
java.lang.RuntimeException: Unable to get provider com.iqiyi.qigsaw.sample.java.JavaContentProvider: java.lang.ClassNotFoundException: Didn't find class "com.iqiyi.qigsaw.sample.java.JavaContentProvider" on path: DexPathList[[zip file "/data/app/~~jt2UDqoG_kzUh5O2ypnuuA==/com.iqiyi.qigsaw.sample-oFjDdIHcuKNiFOeCd4gxkQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~jt2UDqoG_kzUh5O2ypnuuA==/com.iqiyi.qigsaw.sample-oFjDdIHcuKNiFOeCd4gxkQ==/lib/arm64, /system/lib64, /system_ext/lib64, /vendor/lib64, /odm/lib64]]
at android.app.ActivityThread.installProvider(ActivityThread.java:7799)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7335)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7221)
at android.app.ActivityThread.access$1500(ActivityThread.java:293)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2135)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:260)
at android.app.ActivityThread.main(ActivityThread.java:8241)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.iqiyi.qigsaw.sample.java.JavaContentProvider" on path: DexPathList[[zip file "/data/app/~~jt2UDqoG_kzUh5O2ypnuuA==/com.iqiyi.qigsaw.sample-oFjDdIHcuKNiFOeCd4gxkQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~jt2UDqoG_kzUh5O2ypnuuA==/com.iqiyi.qigsaw.sample-oFjDdIHcuKNiFOeCd4gxkQ==/lib/arm64, /system/lib64, /system_ext/lib64, /vendor/lib64, /odm/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:147)
at androidx.core.app.CoreComponentFactory.instantiateProvider(CoreComponentFactory.java:62)
at android.app.ActivityThread.installProvider(ActivityThread.java:7783)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7335) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7221) 
at android.app.ActivityThread.access$1500(ActivityThread.java:293) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2135) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:260) 
at android.app.ActivityThread.main(ActivityThread.java:8241) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006) 

@xiangtailiang
Copy link

xiangtailiang commented May 25, 2021

看堆栈是因为xml没有被正确修改,这是修改过程是插件做的,会把JavaContentProvider修改为JavaContentProvider_decorated,试试命令行的方式安装:
./gradlew qigsawInstallDebug

@JarvisBuop
Copy link

我也遇到这个问题,是用as的Run Configurations 去除Dynamic features to deploy 的 java模块重现,选中就正常,去除就是这个错; 另外使用qigsawInstallDebug命令行正常; 这个是什么原因,有大佬解答一下吗

@xiangtailiang
Copy link

我也遇到这个问题,是用as的Run Configurations 去除Dynamic features to deploy 的 java模块重现,选中就正常,去除就是这个错; 另外使用qigsawInstallDebug命令行正常; 这个是什么原因,有大佬解答一下吗

因为用AS的run,是把每个feature都打包成一个apk,然后通过 adb install-multiple安装的,这是系统支持的分包,不需要走qigsaw的插件加载流程。如果你去掉了java,那安装的时候就会少了java那个apk,里面的类JavaContentProvider当然会找不到了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants