【错误记录】集成 Tinker 热修复报错 ( No such property: variantConfiguration for class: .ApplicationVariantData )
2023-09-27 14:29:15 时间
一、报错信息
接入 Tinker 热修复 , 使用如下 Gradle 插件 ,
// Tinker 的 tinker-patch-gradle-plugin 插件
classpath "com.tencent.tinker:tinker-patch-gradle-plugin:1.9.1"
应用该插件时报错 ;
plugins {
id 'com.tencent.tinker.patch'
}
报错信息如下 ;
> Configure project :app
----------------------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!
-----------------------------------------------------------------
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> No such property: variantConfiguration for class: com.android.build.gradle.internal.variant.ApplicationVariantData
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at
Caused by: groovy.lang.MissingPropertyException: No such property: variantConfiguration for class: com.android.build.gradle.internal.variant.ApplicationVariantData
at com.tencent.tinker.build.gradle.TinkerPatchPlugin$_apply_closure1$_closure2.doCall(TinkerPatchPlugin.groovy:133)
* Get more help at https://help.gradle.org
BUILD FAILED in 522ms
二、解决方案
原来的 Gradle 和 Gradle 插件版本太高 :
降低 Gradle 及 Gradle 插件版本 :
目前报如下警告 , 可以暂时忽略该警告 ;
API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app
相关文章
- HTTP错误500.22 检测到在集成的托管管道模式下不适用的ASP.NET设置
- js 时间戳转换,全网最牛业务逻辑解析,逐行解析代码,千万不要错过,里面有些错误场景你可能还不知道
- 超简单的方法安装wget,以及中途遇见的错误解决方案
- Xamarin Android提示内存溢出错误
- ERR_NAME_NOT_RESOLVED错误的解决
- (数据科学学习手札135)tenacity:Python中最强大的错误重试库
- [第四届蓝桥杯省赛C++A/B组]错误票据
- HTTP常见错误编号
- VS Code 忽略 composite literal uses unkeyed fields 错误
- 【Analytics Kit】【FAQ】集成华为分析服务问题集合 SDK初始化失败/应用调试界面没有数据/常见错误提示
- Verilog与SystemVerilog编程陷阱:怎样避免101个常犯的编码错误
- 系统断定检查已失败。有关详细信息,请查看 SQL Server 错误日志
- 如何解决“504 Gateway Time-out”错误
- [Power Query] 删除错误/空值