我正在尝试将LinkedIn集成到我的Android应用中,并得到回应


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


如果有人可以帮助,请。

我的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)'

}

最佳答案

使用linkedin-sdk-release.aar进行一些更改后,可能会发生此问题。

就像我一样,我将其打开并删除一些目录,然后再将其包含在项目中。

当我对此错误感到困惑时,我使用选项--stacktrace运行gradlew:

./gradlew :app:assembleDebug --stacktrace
输出为(省略详细信息跟踪):

```


  任务:app:checkDebugClasspath失败


失败:构建失败,发生异常。


什么地方出了错:
无法解析配置':app:debugCompileClasspath'的所有文件。


  使用转换ExtractAarTransform无法转换文件'mmkv-1.0.13.aar'以匹配属性{artifactType = android-exploded-aar}
  java.lang.IllegalArgumentException:格式错误
  ```



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

当然错误消失了。

关于android - 无法转换文件“linkedin-sdk-release.aar”以匹配属性,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52158952/

10-11 03:24
查看更多