无法使用转换AarTransform转换文件'45907c80e09917e1b776adf038505958'以匹配属性{artifactType = jar} [英] Failed to transform file '45907c80e09917e1b776adf038505958' to match attributes {artifactType=jar} using transform AarTransform

查看:128
本文介绍了无法使用转换AarTransform转换文件'45907c80e09917e1b776adf038505958'以匹配属性{artifactType = jar}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Android 3.0 canary 4并制作一个应用程序.直到昨天一切都很好,但是今天当我打开项目时,它给了我一个错误

I am using Android 3.0 canary 4 and making an app. Everything was working fine until yesterday, but today when i opened the project, it gave me an error

 F:\test projects\SellIT\app\build.gradle
Error:Failed to resolve: Failed to transform file '45907c80e09917e1b776adf038505958' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file '0424053f6b3433893454e7542cca3a9d' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file 'customtabs-25.0.0.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file 'recyclerview-v7-25.4.0.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file 'b7ae5d97f624a2ac68ed171c25f74f21' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file 'firebase-analytics-impl-10.2.4.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file '8a727da2aab64813ae6d20842b03d41f' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file 'support-compat-25.4.0.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

Error:Failed to resolve: Failed to transform file 'd0da7bf76907aa33e493551504efa952' to match attributes {artifactType=jar} using transform AarTransform
<a href="openFile:F:/test projects/SellIT/app/build.gradle">Open File</a>

这是我的build.gradle(应用级别)

    apply plugin: 'com.android.application'


android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "android.sellit"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:25.4.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-auth:10.2.4'

    // Required only if Facebook login support is required
    implementation('com.facebook.android:facebook-android-sdk:4.22.1')
    implementation 'com.google.firebase:firebase-core:10.2.4'
    implementation 'com.google.firebase:firebase-database:10.2.4'
    implementation 'com.google.android.gms:play-services-auth:10.2.4'
    implementation 'com.android.support:design:25.4.0'

    implementation 'com.github.bumptech.glide:glide:4.0.0-RC1'

    implementation 'com.google.firebase:firebase-storage:10.2.4'

    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.google.firebase:firebase-crash:10.2.4'

    implementation 'com.google.firebase:firebase-ads:10.2.4'
}
apply plugin: 'com.google.gms.google-services'

有人遇到类似的错误,或者他知道我该怎么办?

Has anyone encountered a similar error or he knows what can I do?

推荐答案

事实证明,这是Gradle本身的怪异错误.我将其发布在Google论坛上,他们的一名编码员给了我一个解决方案,并将其作为gradle团队的一个问题提出来.

It turns out that this is a weird bug in the Gradle itself. I posted it on google forum and one of their coders gave me a solution and also put it up as an issue with the gradle team.

对于该解决方案,您可以清除项目缓存(C:\Users\<username>\.gradle\caches\transforms-1)并再次重建项目,它将正常运行. Gradle需要构建一些工件,这些工件存储在缓存中.因此,如果gradle无法建立,则可以清除缓存,这将提示重新下载.只要您需要的所有工件都已下载到Gradle的缓存中,您就可以处于离线状态(因此,离线时请勿删除缓存文件夹!)

For the solution, you can clear your project cache (C:\Users\<username>\.gradle\caches\transforms-1 ) and rebuild your project again and it will work fine. The gradle needs some artifacts to build which are stored in the cache memory. So if the gradle fails to build, the cache can be cleared which will prompt fresh downloading. You can be offline as long as all the artifacts you need have been downloaded in Gradle's cache (so don't delete the cache folder when offline!)

这篇关于无法使用转换AarTransform转换文件'45907c80e09917e1b776adf038505958'以匹配属性{artifactType = jar}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆