bytedance / CodeLocator

Apache License 2.0
1.85k stars 150 forks source link

热修复第三方库,需要的代理applicaiton,无法使用 #70

Open zhujian1989 opened 1 month ago

zhujian1989 commented 1 month ago

java.lang.RuntimeException: Unable to get provider com.bytedance.tools.codelocator.CodeLocatorProvider: java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Application at android.app.ActivityThread.installProvider(ActivityThread.java:8383) at android.app.ActivityThread.installContentProviders(ActivityThread.java:7889) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7576) at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2428) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:257) at android.os.Looper.loop(Looper.java:368) at android.app.ActivityThread.main(ActivityThread.java:8839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049) Caused by: java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Application at com.bytedance.tools.codelocator.CodeLocatorProvider.attachInfo(CodeLocatorProvider.java:22) at android.app.ActivityThread.installProvider(ActivityThread.java:8378) at android.app.ActivityThread.installContentProviders(ActivityThread.java:7889)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7576)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2428)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:257)  at android.os.Looper.loop(Looper.java:368)  at android.app.ActivityThread.main(ActivityThread.java:8839)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049) 

zhujian1989 commented 1 month ago
implementation "com.tencent.rfix:RFix-android-lib:2.0.0-beta2"
compileOnly "com.tencent.rfix:RFix-android-anno:2.0.0-beta2"
kapt "com.tencent.rfix:RFix-android-anno:2.0.0-beta2"