Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 渐变错误:无法转换文件以匹配已简化的属性_Android_Gradle_Azure Pipelines - Fatal编程技术网

Android 渐变错误:无法转换文件以匹配已简化的属性

Android 渐变错误:无法转换文件以匹配已简化的属性,android,gradle,azure-pipelines,Android,Gradle,Azure Pipelines,我已经建立了一个管道,在microsoft中运行我的测试。在我的本地机器上,这工作正常,jetified libidpmobile debug.jar文件位于我机器上的gradle系统目录中: /Users/jimclermonts/.gradle/caches/transforms-2/files-2.1/efad9765ab457848824459e0c76abddc/jetified-libidpmobile-debug.jar 这是我的build.gradle: debugImplem

我已经建立了一个管道,在microsoft中运行我的测试。在我的本地机器上,这工作正常,
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.jar
是由
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
以下是my 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'
我尝试了解决方案,但没有结果。 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
}

似乎是错误
导致的数据绑定问题,任何处理器都无法识别以下选项:'[android.databinding.minApi….

您可以尝试在下面的行中添加build.gradle文件

kapt“com.android.databinding:compiler:$gradle\u version”

有关详细信息,您可以查看以下类似线程:


希望以上有帮助!

我使用了
jetifier standalone
对文件进行了jetifier。将其添加到
gradle.properties

android.jetifier.blacklist = libidpmobile

现在它可以工作了。

我已经有了:数据绑定{enabled=true}我认为问题在于对某些jar文件进行jetifig。这在CI上不成功,但在我的本地机器上工作正常。我现在看到错误消息已经更改。但在添加数据绑定库之后就没有了。可能是因为cloud agent中使用的java jdk与您的本地机器不同吗?您可以尝试设置
jdkVersionOption
用于gradle任务,以确保Clold代理中的环境与您的本地计算机相同。是否使用Java 1.8?是否在生成服务器的gradle.properties中使用了android。enableJetifier=true?