Tencent / tinker

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

Application 配置在子Module中,Tinker执行app:tinkerSupportProcessDebugManifest时在主module中找Application #852

Closed Darksiderlyd closed 6 years ago

Darksiderlyd commented 6 years ago

异常类型:编译异常

手机型号:

手机系统版本:

tinker版本:1.9.0

gradle版本:3.1.0

是否使用热更新SDK:Bugly SDK

系统: Mac

堆栈/日志: 说明: 设置 enableProxyApplication = true 开启了反射Application模式 我的XxxApplicaotion 在子Module中, 但是Tinker在主app主模块中配置,Tinker在主模块中找不到我的Application 在不移动我的Application时有没有解决方法

Error:TinkerSupport Plugin Version: 1.1.0 Requires: Android Plugin for Gradle, Revision 2.0.0 or higher Dependencies: Gradle 2.10 or higher (Current Gradle Version: 4.6)

apply plugin: 'com.tencent.tinker.patch' ----------------------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.

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/yaodonglv/WorkSpace/android-chess/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 = /Users/yaodonglv/WorkSpace/android-chess/app/release_file/app-release.apk ignoreWarning = false useSign = true buildConfig { applyMapping = /Users/yaodonglv/WorkSpace/android-chess/app/release_file/app-release-mapping.txt applyResourceMapping = /Users/yaodonglv/WorkSpace/android-chess/app/release_file/app-release-R.txt tinkerId = xqs_1_1.0 keepDexApply = false isProtectedApp = false supportHotplugComponent = false } 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:Pre outputVariantName:Pre variantName:Debug outputVariantName:Debug variantName:Release outputVariantName:Release tinker add tinker_id_xqs_1_1.0 to your AndroidManifest.xml /Users/yaodonglv/WorkSpace/android-chess/app/build/intermediates/manifests/full/debug/AndroidManifest.xml tinker add com.xqs.base.service.base.XqsApplication to dex loader pattern tinker gen AndroidManifest.xml in build/intermediates/tinker_intermediates/AndroidManifest.xml apply resource mapping file /Users/yaodonglv/WorkSpace/android-chess/app/release_file/app-release-R.txt is illegal, just ignore app version:1.0.1 Remove TINKER_ID tinker_id_xqs_1_1.0 FAILURE: Build failed with an exception.

tys282000 commented 6 years ago

这个暂时真没办法,Application在其他module里,tinker插件在编译时不好去逐个module查找,可以考虑在app module里加个壳Application继承子module里的那个Application,虽然有点丑,不过至少能跑了。

Darksiderlyd commented 5 years ago

好的谢谢已解决

YaoHhuiling commented 2 years ago

你好,请问是怎么解决的呀?