gradle 任务“:app:dataBindingMergeDependencyArtifactsRelease”Azure管道执行失败

ehxuflar  于 2023-11-18  发布在  其他
关注(0)|答案(1)|浏览(310)

在构建应用程序时,我在Gradle@2 assemble release任务中的Azure管道中遇到了一个奇怪的问题。它之前工作正常,并且在gradle文件和管道.yml文件中没有进行任何更改。这是我遇到的错误,

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsRelease'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
   > Could not find com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.2.1.
     Required by:
         project :app

* 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

字符串

**请注意,apk在本地机器上构建良好,没有任何问题(发布和调试)。**这是yml文件中用于构建apk的代码,

- task: Gradle@2
    displayName: "Gradle Assemble Release"
    inputs:
      gradleWrapperFile: 'gradlew'
      tasks: 'assembleRelease'
      publishJUnitResults: false
      javaHomeOption: 'JDKVersion'
      jdkVersionOption: '1.11'
      sonarQubeRunAnalysis: false
      spotBugsAnalysis: false


gradle文件,

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace '****'
    compileSdk 33

    defaultConfig {
        applicationId "****"
        minSdk 21
        targetSdk 33
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        debug {
            .
            .
        }
        release {
            .
            .
        }
    }

    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            .
            .
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    dataBinding {
        android.buildFeatures.dataBinding = true
        enabled = true
    }
}
apply plugin: 'kotlin-kapt'

dependencies {
    def room_version = "2.5.0"

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'com.google.android.material:material:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation 'com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.2.1'

    implementation "androidx.room:room-runtime:$room_version"
    annotationProcessor "androidx.room:room-compiler:$room_version"

    // To use Kotlin annotation processing tool (kapt)
    kapt "androidx.room:room-compiler:$room_version"
    implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
    implementation 'io.reactivex.rxjava3:rxjava:3.1.5'

    implementation "io.arrow-kt:arrow-core:1.0.0"

    // koin -> inversion of control
    implementation "io.insert-koin:koin-android:3.3.3"
    implementation "io.insert-koin:koin-androidx-compose:3.4.2"

    implementation 'org.ini4j:ini4j:0.5.4'

    implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.1"

    implementation 'com.google.code.gson:gson:2.10.1'

    testImplementation 'org.jetbrains.kotlin:kotlin-test'
    testImplementation "org.mockito:mockito-core:3.+"
    testImplementation "org.mockito:mockito-inline:3.+"
    testImplementation "org.robolectric:robolectric:4.6.1"
    testImplementation "androidx.arch.core:core-testing:2.2.0"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6"

    androidTestImplementation 'org.jetbrains.kotlin:kotlin-test'
    androidTestImplementation "org.mockito:mockito-android:3.+"
    androidTestImplementation "org.robolectric:robolectric:4.6.1"
    androidTestImplementation "androidx.arch.core:core-testing:2.2.0"
}


请注意,gradle文件或yml文件没有做任何更改,几周前它们工作正常。今天我突然遇到了这个问题。对此,任何帮助都将不胜感激。提前感谢。

twh00eeo

twh00eeo1#

这是由于库的版本而发生的。在我将build.gradle更新到版本之后,

implementation 'com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.3.0'

字符串
构建成功。但不确定为什么它在本地工作而不是在管道中工作

相关问题