首页 > 解决方案 > 无法转换文件“linkedin-sdk-release.aar”以匹配属性

问题描述

我正在尝试将 LinkedIn 集成到我的 Android 应用程序中并收到回复

无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法使用转换ExtractAarTransform转换文件“linkedin-sdk-release.aar”以匹配属性{artifactType = android-exploded-aar}

如果有人可以帮忙,请。

我的 buld.gradle 文件是

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "e.musalastborn.truckers1"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        useLibrary 'org.apache.http.legacy'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        cxxxxxxc
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

    }
    buildToolsVersion '28.0.0'
}

//dependencies added to the app.
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.0.2'
    compile project(path: ':linkedin-sdk', configuration: 'default')
    compile 'com.android.volley:volley:1.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.google.android.gms:play-services-maps:12.0.1'
    testImplementation 'junit:junit:4.12'
    compile 'com.firebase:firebase-jobdispatcher:0.6.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.android.gms:play-services-auth:12.0.1'
    compile 'com.google.maps:google-maps-services:0.1.7'
    compile 'org.slf4j:slf4j-nop:1.7.25'
    implementation 'com.google.android.gms:play-services-location:12.0.1'
    implementation 'com.facebook.android:facebook-login:[4,5)'

}

标签: android

解决方案


这个问题可能发生在您对linkedin-sdk-release.aar.

就像我一样,我打开那个 aar 并删除一些目录,然后再包含在我的项目中。

虽然我对此错误感到困惑,但我使用选项运行gradlew--stacktrace

./gradlew :app:assembleDebug --stacktrace 输出是(省略了详细的轨迹跟踪):

```

任务 :app:checkDebugClasspath 失败

FAILURE:构建失败并出现异常。

  • 出了什么问题:无法解析配置“:app:debugCompileClasspath”的所有文件。

    无法使用转换 ExtractAarTransform java.lang.IllegalArgumentException 转换文件“mmkv-1.0.13.aar”以匹配属性 {artifactType=android-exploded-aar}:MALFORMED ```

看到MALFORMED关键字我注意到我的错,然后我提取原始 aar 并像以前一样执行工作(删除一些目录),我重新压缩更改的 zip 应用程序(ubuntu 的默认压缩工具)。

当然错误消失了。


推荐阅读