集成騰訊bugly全量更新出現(xiàn)以下問題:
2020-09-17 14:39:02.357 10422-10541/com.zhongjh.phone.ui W/CrashReport: java.lang.ExceptionInInitializerError
at com.tencent.bugly.beta.upgrade.c.a(BUGLY:427)
at com.tencent.bugly.beta.upgrade.c.a(BUGLY:302)
at com.tencent.bugly.beta.upgrade.a.a(BUGLY:97)
at com.tencent.bugly.proguard.al.a(BUGLY:188)
at com.tencent.bugly.proguard.al.run(BUGLY:473)
at com.tencent.bugly.proguard.ak$2.run(BUGLY:757)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
Caused by: java.lang.IllegalStateException: Method addObserver must be called on the main thread
at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:317)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:172)
at androidx.fragment.app.Fragment.initLifecycle(Fragment.java:471)
at androidx.fragment.app.Fragment.<init>(Fragment.java:451)
at com.tencent.bugly.beta.ui.b.<init>(BUGLY:17)
at com.tencent.bugly.beta.ui.a.<init>(BUGLY:44)
at com.tencent.bugly.beta.ui.h.<init>(BUGLY:45)
at com.tencent.bugly.beta.ui.h.<clinit>(BUGLY:60)
at com.tencent.bugly.beta.upgrade.c.a(BUGLY:427)
at com.tencent.bugly.beta.upgrade.c.a(BUGLY:302)
at com.tencent.bugly.beta.upgrade.a.a(BUGLY:97)
at com.tencent.bugly.proguard.al.a(BUGLY:188)
at com.tencent.bugly.proguard.al.run(BUGLY:473)
at com.tencent.bugly.proguard.ak$2.run(BUGLY:757)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
后來找了一天的bug鲤拿,通過排除法發(fā)現(xiàn)是
api "androidx.activity:activity-ktx:1.2.0-alpha08"
引起的問題……
如果對你有用,請點贊給我更多動力謝謝