在Android12版本的车机上出现的兼容性问题

Aperta
#1,365 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
android, java
Ambito
mobile

Direzione di ricerca

Start by reproducing the reported ClassNotFoundException on the affected Android 12 car head unit, then compare plugin startup with the Android 11 head unit and Android 12 emulator. The report points to PluginDefaultProxyActivity and the host manifest but gives no source file, test, or confirmed cause. Done means identifying and documenting a reproducible compatibility cause and a fix that allows the plugin to launch on the affected device.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

大佬,请教下:
在某家车企的Android12版本的车机上启动插件会报错找不到com.tencent.shadow.sample.plugin.runtime.PluginDefaultProxyActivity,在宿主的manifest文件中也有正常注册,关键是在另一款Android11的车机和Android12的模拟器上启动插件就没有问题,很奇怪的一个报错。
使用shadow的demo也试了下,也是同样的在Android11的车机上正常启动插件,在Android12的车机上启动插件会报相同的错误,具体报错信息如下:
FATAL EXCEPTION: main
Process: com.kernelsoft.exampleapp119, PID: 19859
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.kernelsoft.exampleapp119/com.tencent.shadow.sample.plugin.runtime.PluginDefaultProxyActivity}: java.lang.ClassNotFoundException: Didn't find class "com.tencent.shadow.sample.plugin.runtime.PluginDefaultProxyActivity" on path: DexPathList[[zip file "/data/app/~~JjNcPsG65Y9BZxie_Hl_GQ==/com.kernelsoft.exampleapp119-9ODCBWiltcBlBjvJAgmf3Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~JjNcPsG65Y9BZxie_Hl_GQ==/com.kernelsoft.exampleapp119-9ODCBWiltcBlBjvJAgmf3Q==/lib/arm64, /data/app/~~JjNcPsG65Y9BZxie_Hl_GQ==/com.kernelsoft.exampleapp119-9ODCBWiltcBlBjvJAgmf3Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3613)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3864)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2253)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:297)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tencent.shadow.sample.plugin.runtime.PluginDefaultProxyActivity" on path: DexPathList[[zip file "/data/app/~~JjNcPsG65Y9BZxie_Hl_GQ==/com.kernelsoft.exampleapp119-9ODCBWiltcBlBjvJAgmf3Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~JjNcPsG65Y9BZxie_Hl_GQ==/com.kernelsoft.exampleapp119-9ODCBWiltcBlBjvJAgmf3Q==/lib/arm64, /data/app/~~JjNcPsG65Y9BZxie_Hl_GQ==/com.kernelsoft.exampleapp119-9ODCBWiltcBlBjvJAgmf3Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1285)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3600)
... 12 more

目前的一个思路就是这款车机的类加载机制可能魔改的比较多,出现了兼容性问题

Lingua principale
Java
Stelle
7.8k
Fork
1.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Tencent/Shadow

Tutte le issue di Tencent/Shadow

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.