Android開發——整合Tinker熱更新框架出現java.lang.NoClassDefFoundError
阿新 • • 發佈:2019-01-04
前言
在Android開發當中,Tinker熱更新是很常見的使用框架,但是我今天在整合的時候卻出現異響不到的事情,出現bug了。應用啟動出現Tinker.UncaughtHandler: TinkerUncaughtHandler catch exception:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/tencent/tinker/entry/ApplicationLike;
出現問題的依賴
model中的遠端依賴
//更新應用的 implementation 'com.tencent.bugly:crashreport_upgrade:1.3.6' // 指定tinker依賴版本(注:應用升級1.3.5版本起,不再內建tinker) implementation 'com.tencent.tinker:tinker-android-lib:1.9.8' implementation 'com.tencent.bugly:nativecrashreport:3.3.1'
project中的遠端依賴
classpath "com.tencent.bugly:tinker-support:1.1.2"
解決辦法
將兩個build.gradle檔案裡面的依賴修改一下
model中的遠端依賴
//更新應用的 implementation 'com.tencent.bugly:crashreport_upgrade:1.3.6' // 指定tinker依賴版本(注:應用升級1.3.5版本起,不再內建tinker) implementation 'com.tencent.tinker:tinker-android-lib:1.9.9' implementation 'com.tencent.bugly:nativecrashreport:3.3.1'
project中的遠端依賴
classpath "com.tencent.bugly:tinker-support:1.1.3"
我將上述的地方修改之後就應用可以運行了。