Tinker接入踩的坑

时间:2022-03-04 09:12:10

问题一:

Error:A problem occurred configuring project ':app'.

> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not resolve com.tencent.tinker:tinker-android-lib:1.7.7.
     Required by:
         BCP:app:unspecified
      > Could not resolve com.tencent.tinker:tinker-android-lib:1.7.7.
         > Could not get resource 'https://jcenter.bintray.com/com/tencent/tinker/tinker-android-lib/1.7.7/tinker-android-lib-1.7.7.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/tencent/tinker/tinker-android-lib/1.7.7/tinker-android-lib-1.7.7.pom'.
               > jcenter.bintray.com
               
               Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details


解决办法:

这是由于代码混淆后,导致Tinker无法做Release的打包。解决的办法,请参考我的另一篇博客《http://blog.csdn.net/chendaivin/article/details/58594149


问题二:
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.


Error:Execution failed for task ':app:validateSigningRelease'.

> Keystore file \null not found for signing config 'release'.


解决办法:

这是由于build的脚本编写问题



问题三:
Error:A problem occurred configuring project ':app'.
> Tinker does not support instant run mode, please trigger build by assembleDebug or disable instant run in 'File->Settings...'.


解决办法:

这是由于Tinker对于instant run的兼容问题




问题四:

Version: 3.16(36)
Android: 4.4.4(MI PAD)
Exception: Couldn't load cvcardpro_api from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.betawm.baw-2.apk", zip file "/data/data/com.betawm.baw/code_cache/secondary-dexes/com.betawm.baw-2.apk.classes2.zip"],nativeLibraryDirectories=[/data/app-lib/com.betawm.baw-2, /vendor/lib, /system/lib]]]: findLibrary returned null
java.lang.Runtime.loadLibrary(Runtime.java:358)
java.lang.System.loadLibrary(System.java:526)
com.sensetime.card.CardRecognizer.<clinit>(CardRecognizer.java:34)
com.sensetime.idcard.IDCardScanner.initRecognizer(IDCardScanner.java:121)
com.sensetime.card.CardScanner$1.run(CardScanner.java:130)
java.lang.Thread.run(Thread.java:841)


解决办法:

这是由于打包的脚本,没有对应平台的支持so文件。这个最好的解决办法,就是把原有的正常apk的安装包,解压出来,把里面的libs目录中,各平台的支持库都放到新的工程目录下。