由于play-services-base-17.1.0.aar转换错误,因此无法建立专案 [英] Cannot build a project due to play-services-base-17.1.0.aar transformation error

查看:635
本文介绍了由于play-services-base-17.1.0.aar转换错误,因此无法建立专案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,基本上,我已经有近一年没有打开我的Android Studio项目了,这一次是打开和构建它的时候了.更新了Android Studio和项目的所有插件之后,我终于遇到此错误:

So basically I haven't opened my Android Studio project for almost a year and this time was the time for it to be opened and built. After updating Android Studio and all of the project's plugins, I finally reach this error:

Execution failed for task ':app:processDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform play-services-base-17.1.0.aar (com.google.android.gms:play-services-base:17.1.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
      > Execution failed for AarResourcesCompilerTransform: C:\Users\Me\.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0.
         > AAPT2 aapt2-4.1.1-6503028-windows Daemon #0: Unexpected error during compile 'C:\Users\Me\.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0\res\drawable-xhdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png', attempting to stop daemon.
           This should not happen under normal circumstances, please file an issue if it does.

我希望有人可以帮助我解决此问题.预先感谢.

I hope someone could help me resolve this issue. Thanks in advance.

推荐答案

您好,问题完全相同.该项目基于3台经过测试的PC中的2台.我看到的唯一区别是,在较旧的AMD处理器上无法正常工作.与之配合使用的PC均具有两个Intel CPU(较旧的i7、2.Gen和新的i7).所有三台PC均与Windows 10 Pro一起运行.我的开发环境在所有3台PC上均设置相同.

Hi have exactly the same issue. The project builds on 2 of 3 tested PCs. The only difference I see is, that is not working on an older AMD processor. The PCs its working with have both Intel CPUs (an older i7, 2. Gen, and a new i7). All three PCs are running with Windows 10 Pro. My dev environment is set up equally on all 3 PCs.

我希望这些信息有助于找到更好的解决方案.我发现的唯一解决方案是回到Gradle插件的早期版本和Gradle本身.

I hope this information helps to find a maybe better solution. The only solution I found is to go back to a previous version of the Gradle plugin and Gradle itself.

在gradle-wrapper属性中,我定义了Gradle版本6.1.1

In gradle-wrapper properties I defined Gradle version 6.1.1

distributionUrl = https://services.gradle.org/distributions/gradle-6.1.1-all.zip

distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip

然后在build.gradle项目中设置版本4.0.2

And in the project build.gradle I set version 4.0.2

classpath'com.android.tools.build:gradle:4.0.2'

classpath 'com.android.tools.build:gradle:4.0.2'

这篇关于由于play-services-base-17.1.0.aar转换错误,因此无法建立专案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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