前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【错误记录】集成 Tinker 热修复报错 ( No such property: variantConfiguration for class: .ApplicationVariantData )

【错误记录】集成 Tinker 热修复报错 ( No such property: variantConfiguration for class: .ApplicationVariantData )

作者头像
韩曙亮
发布2023-03-29 10:21:18
6480
发布2023-03-29 10:21:18
举报
文章被收录于专栏:韩曙亮的移动开发专栏

文章目录

一、报错信息


接入 Tinker 热修复 , 使用如下 Gradle 插件 ,

代码语言:javascript
复制
        // Tinker 的 tinker-patch-gradle-plugin 插件
        classpath "com.tencent.tinker:tinker-patch-gradle-plugin:1.9.1"

应用该插件时报错 ;

代码语言:javascript
复制
plugins {
    id 'com.tencent.tinker.patch'
}

报错信息如下 ;

代码语言:javascript
复制
> 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 插件版本 :

在这里插入图片描述
在这里插入图片描述

目前报如下警告 , 可以暂时忽略该警告 ;

代码语言:javascript
复制
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
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-04-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 文章目录
  • 一、报错信息
  • 二、解决方案
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档