Tencent / tinker

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Other
17.16k stars 3.33k forks source link

gradle 6.5 打包apk 报错:you must init tinker plugin first! #1530

Open arestory opened 3 years ago

arestory commented 3 years ago

异常类型:打包异常

手机型号:如:Nexus 5(如是编译异常,则可以不填)

手机系统版本:如:Android 5.0 (如是编译异常,则可以不填)

tinker版本:如:1.9.14.6

gradle版本:如:6.5

是否使用热更新SDK:是

系统:Mac

堆栈/日志:

----------------------tinker build warning ------------------------------------ tinker auto operation: excluding annotation processor and source template from app packaging. Enable dx jumboMode to reduce package size. enable dx jumboMode to reduce package size. disable preDexLibraries to prevent ClassDefNotFoundException when your app is booting. disable archive dex mode so far for keeping dex apply.

tinker will change your build configs: we will add TINKER_ID=null in your build output manifest file build/intermediates/manifests/full/*

if minifyEnabled is true you will find the gen proguard rule file at build/intermediates/tinker_intermediates/tinker_proguard.pro and we will help you to put it in the proguardFiles.

if multiDexEnabled is true you will find the gen multiDexKeepProguard file at build/intermediates/tinker_intermediates/tinker_multidexkeep.pro and we will help you to put it in the MultiDexKeepProguardFile.

if applyResourceMapping file is exist we will build app apk with resource R.txt file if resources.arsc has changed, you should use applyResource mode to build the new apk!

----------------------tinker-support build warning ------------------------------------ if you not set autoBackupApkDir we will auto backup the build file to /Users/yuwenque/Documents/casstime/gerrit/cassecstore_android/app/tinker.

if overrideTinkerPatchConfiguration is true we will override tinker patch configuration,you must use tinker-support's configuration

you will find the gen proguard rule file at build/intermediates/bugly_intermediates/bugly_proguard.pro and we will help you to put it in the proguardFiles.

if enableProxyApplication is true we will replace you real application to TINKER_PATCH_APPLICATION

if autoGenerateTinkerId is true we will auto set base tinkerId as versionName.versionCode, like 1.0.1

------ Tinker Support Override tinkerPatch Configuration ------ tinkerPatch { tinkerEnable = true oldApk = ignoreWarning = false useSign = true buildConfig { applyMapping = null applyResourceMapping = null tinkerId = 0223-16-20-03 keepDexApply = false isProtectedApp = true supportHotplugComponent = true } dex { dexMode = jar pattern = [classes.dex, assets/secondary-dex-?.jar] loader = [com.tencent.tinker.loader.] } lib { pattern = [lib//.so] } res { pattern = [res/, r/, assets/, resources.arsc, AndroidManifest.xml] ignoreChange = [assets/_meta.txt] largeModSize = 100 } packageConfig { } sevenZip { zipArtiface = com.tencent.mm:SevenZip:1.1.10 path = } ------ End ------ variantName:_devDebug outputVariantName:_dev-debug

FAILURE: Build failed with an exception.

BUILD FAILED in 1s

tigerose commented 3 years ago

我是5.4.1,也是无法再升版本了

dazeGitHub commented 3 years ago

我是5.4.1,也是无法再升版本了

我也是,太坑了

shinecjj commented 3 years ago

这个问题有解决么?我这边也出现这个问题,升级gradle 6.9, AGP 4.0.1 后:

ccclll1990 commented 3 years ago

classpath "com.tencent.bugly:tinker-support:1.2.3"

implementation 'com.tencent.bugly:nativecrashreport:3.9.0' implementation 'com.tencent.tinker:tinker-android-lib:1.9.14.17' implementation 'com.tencent.bugly:crashreport_upgrade:1.5.23'

xfort commented 3 years ago

升级到 classpath 'com.android.tools.build:gradle:7.0.0' classpath 'com.tencent.bugly:tinker-support:1.2.3' 也是build failed

ludaxin6 commented 2 years ago

gradle 7.2 遇到同样问题,跪求解决方案呢

FTDShanCai commented 2 years ago

classpath "com.android.tools.build:gradle:4.2.1" classpath "com.tencent.bugly:tinker-support:1.2.3"
主要还是tinker-support插件的版本

gradle-6.7.1 正常

zhangshaokang101 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

canlan818 commented 2 years ago

这是来自QQ邮箱的自动回复邮件。您好,来信已收到,谢谢您,我会及时回复您的!O(∩_∩)O~

jacklongway commented 2 years ago

您好!很高兴收到您的邮件,稍后查看。

zhbzhbzhbz commented 2 years ago

亲测,使用这篇的配置,打包才一切正常: Gradle插件版本(3.6.3):classpath 'com.android.tools.build:gradle:3.6.3' Gradle版本(5.6.4):distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip Bugly Gradle插件版本(1.2.3):classpath "com.tencent.bugly:tinker-support:1.2.3" Tinker插件版本(1.9.14.16):implementation 'com.tencent.tinker:tinker-android-lib:1.9.14.16'