Tencent / tinker

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

同一个代码分支,在不同机器上打包, AndroidManifest.xml 中有时会没有TINKER_ID #1711

Open lswc225 opened 1 year ago

lswc225 commented 1 year ago

同一个代码分支,在不同机器上打包,有时候会出现 AndroidManifest.xml 中没有TINKER_ID,只有tinker_version的情况.出现的概率不高,大概十分之一.同时希望了解一下,不同的物理硬件是否对,打包结果有影响.不同的CPU架构,对于最后打包,进行差量包生成是是否会有影响.

以下是环境,机器上的软件版本都是统一的.

tinker版本: 1.9.14.20 JDK: jdk-11.0.5 gradle: Gradle 6.7.1 Kotlin: 1.3.72 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020 JVM: 11.0.5 (Oracle Corporation 11.0.5+10-LTS) OS: Linux 4.18.20-2.el7.lp.x86_64 amd64

每次打包前,都会执行 ./gradlew clean 构建命令 : ./gradlew assembleRelease

以下是某一次打的包中, AndroidManifest.xml 中没有TINKER_ID时,tinker 相关日志,从上到下,按照时间先后顺序

----------------------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=3.15.1 in your build output manifest file /data/build/temp/372277/Merchantplatform/app/build/intermediates/manifests/full/*

if minifyEnabled is true you will find the gen proguard rule file at /data/build/temp/372277/Merchantplatform/app/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 /data/build/temp/372277/Merchantplatform/app/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 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=3.15.1 in your build output manifest file /data/build/temp/372277/Merchantplatform/app/build/intermediates/manifests/full/*

if minifyEnabled is true you will find the gen proguard rule file at /data/build/temp/372277/Merchantplatform/app/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 /data/build/temp/372277/Merchantplatform/app/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!

Task :app:tinkerProcessHyReleaseManifest tinker add tinker_id_3.15.1 to your AndroidManifest.xml /data/build/temp/372277/Merchantplatform/app/build/intermediates/merged_manifests/hyRelease/AndroidManifest.xml tinker add com.tencent.tinker.loader.* to dex loader pattern tinker gen AndroidManifest.xml in /data/build/temp/372277/Merchantplatform/app/build/intermediates/tinker_intermediates/merged_manifests/hyRelease/AndroidManifest.xml

Task :app:tinkerProcessHyReleaseResourceId apply resource mapping file /data/build/temp/372277/Merchantplatform/app/build/bakApk/app-1223-19-13-31/hy/app-hy-release-R.txt is illegal, just ignore

注: Creating file:///data/build/temp/372277/Merchantplatform/app/build/generated/source/kapt/hyRelease/tinker/application/HyApplication.java

TIANYUANXIXUE commented 5 months ago

请问有找到解决方法吗?我也遇到类似问题,以前是小概率tinker_id没有,最近几乎一直没有了,打包环境是容器化环境,删除重新创建也没用