gpt4 book ai didi

android - Gradle 错误 : Failed to transform file to match attributes jetified

转载 作者:行者123 更新时间:2023-12-03 02:45:43 29 4
gpt4 key购买 nike

我已经建立了一个管道,可以在 microsoft azure pipelines 中运行我的测试。 .在我的本地机器上,这工作正常,jetified-libidpmobile-debug.jar文件位于我机器上的 gradle 系统目录中:

/Users/jimclermonts/.gradle/caches/transforms-2/files-2.1/efad9765ab457848824459e0c76abddc/jetified-libidpmobile-debug.jar
这是我的 build.gradle :
debugImplementation files('libs/libidpmobile-debug.jar')
据我了解, jetified-libidpmobile-debug.jarjetifier 自动创建来自 libidpmobile-debug.jar文件。
输出:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> Could not resolve all files for configuration ':app:_classStructurekaptDebugKotlin'.
> Failed to transform file 'jetified-libidpmobile-debug.jar' to match attributes {artifactType=class-structure, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
> Execution failed for StructureArtifactTransform: /Users/iosadmin/.gradle/caches/transforms-2/files-2.1/1e14bb7ec832a0c2c967e6c977ddd9b9/jetified-libidpmobile-debug.jar.
> error in opening zip file
这是我的 azure-pipelines.yml 中组装调试和测试单元测试的部分:
trigger:
- master

pool:
name: Mobile-Pool

steps:
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx4096m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'assembleDebug testDebugUnitTest'
我尝试了 this post 中的解决方案, this postthis post没有结果。
jar 文件有 4mb 大,是代码存储库中唯一的文件,而不是一些 maven 存储库。
将 Gradle 更新到最新版本:
classpath 'com.android.tools.build:gradle:4.0.0-beta05'
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
试图像这样编辑androidmanifest:
tools:replace="android:appComponentFactory"
android:appComponentFactory="androidx.core.app.CoreComponentFactory">
build.gradle:
kotlinOptions {
jvmTarget = '1.8'
}

compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}

最佳答案

我用了jetifier-standalone喷射文件。添加到 gradle.properties :

android.jetifier.blacklist = libidpmobile
现在它可以工作了。

关于android - Gradle 错误 : Failed to transform file to match attributes jetified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62020890/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com