project的build.gradle添加依赖后build报错
# 具体遇到的问题
# 报错信息的截图
app的gradle代码添加依赖后build报错如下:
10:40:29: Executing task 'dependencies'...
Executing tasks: [dependencies] in project E:\Kotlin\HotFix
> Configure project :app
TinkerSupport Plugin Version: 1.1.4
Requires:
Android Plugin for Gradle, Revision 2.0.0 or higher
Dependencies:
Gradle 2.10 or higher (Current Gradle Version: 6.1.1)
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.
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 E:\Kotlin\HotFix\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 = E:\Kotlin\HotFix\app\build\bakApk/app-0208-15-10-00/app-release.apk
ignoreWarning = false
useSign = true
buildConfig {
applyMapping = E:\Kotlin\HotFix\app\build\bakApk/app-0208-15-10-00/app-release-mapping.txt
applyResourceMapping = E:\Kotlin\HotFix\app\build\bakApk/app-0208-15-10-00/app-release-R.txt
tinkerId = base-1.0.1
keepDexApply = false
isProtectedApp = false
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:Debug
outputVariantName:Debug
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> No such property: variantConfiguration for class: com.android.build.gradle.internal.variant.ApplicationVariantData
> can't find tinkerProcessDebugManifest, you must init tinker plugin first!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 336ms
10:40:30: Task execution finished 'dependencies'.
project添加依赖后,build报错如下:
10:43:36: Executing task 'dependencies'...
Executing tasks: [dependencies] in project E:\Kotlin\HotFix
> Configure project :app
TinkerSupport Plugin Version: 1.1.4
Requires:
Android Plugin for Gradle, Revision 2.0.0 or higher
Dependencies:
Gradle 2.10 or higher (Current Gradle Version: 6.1.1)
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.
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 E:\Kotlin\HotFix\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 = E:\Kotlin\HotFix\app\build\bakApk/app-0208-15-10-00/app-release.apk
ignoreWarning = false
useSign = true
buildConfig {
applyMapping = E:\Kotlin\HotFix\app\build\bakApk/app-0208-15-10-00/app-release-mapping.txt
applyResourceMapping = E:\Kotlin\HotFix\app\build\bakApk/app-0208-15-10-00/app-release-R.txt
tinkerId = base-1.0.1
keepDexApply = false
isProtectedApp = false
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:Debug
outputVariantName:Debug
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> No such property: variantConfiguration for class: com.android.build.gradle.internal.variant.ApplicationVariantData
> can't find tinkerProcessDebugManifest, you must init tinker plugin first!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 518ms
10:43:37: Task execution finished 'dependencies'.
# 相关课程内容截图
# 尝试过的解决思路和结果
# 粘贴全部相关代码,切记添加代码注释(请勿截图)
这是app.gradle的代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.hotfixfirsttest"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
ndk {
//设置支持的SO库架构
abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "com.android.support:multidex:1.0.1" // 多dex配置
//注释掉原有bugly的仓库
//compile 'com.tencent.bugly:crashreport:latest.release'//其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.3.4
implementation 'com.tencent.bugly:crashreport_upgrade:1.3.6'
// 指定tinker依赖版本(注:应用升级1.3.5版本起,不再内置tinker)
implementation 'com.tencent.tinker:tinker-android-lib:1.9.9'
implementation 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最新版本号,也可以指定明确的版本号,例如2.2.0
}
// 依赖插件脚本
apply from: 'tinker-support.gradle'
这是Project.build的代码
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
// tinkersupport插件, 其中lastest.release指拉取最新版本,也可以指定明确版本号,例如1.0.4
classpath "com.tencent.bugly:tinker-support:1.1.5"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 116 份
- 解答问题 1012 个
本阶段是提升项目经验的必备,除Android开发的高级控件,还有Android官方大力推荐的开发语言Kotlin,未来Android发展的方向,最后使用Kotlin来开发热门电商项目。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星