AAPT2 编译失败:Android 3.0 Canary 1 上的无效维度

时间:2023-02-02
本文介绍了AAPT2 编译失败:Android 3.0 Canary 1 上的无效维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在使用适用于 Android 的 Instant Apps.我安装了所有正确的软件包,并且厌倦了创建具有 Instant App 支持的新应用程序(在创建新应用程序时选中了 Instant App 复选框).问题是我总是遇到编译工具的问题.有没有其他人有这个问题并且能够找到任何解决方法.

I am playing around with Instant Apps for Android.I installed all the correct packages and tired to create new Application with Instant App support (checked the box for Instant App when crating new application). The problem is that I always run into a problem with compile tools. Does anybody else have this problem and was able to find any workaround.

我的环境:

  • Android Studio 3.0 Canary 1
  • 编译 SDK:25
  • 构建工具:26.0.0 rc2"
  • Gradle 插件:3.0.0-alpha1
  • Gradle:尝试了 gradle-4.0-milestone1 和 2
  • Java 1.8/1.7
  • 操作系统:尝试了 Windows 10 和 Linux Ubuntu 16.4 LTS

错误:

Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/res/merged/androidTest/debug /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml
Issues:
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:520 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:521 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:568 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:594 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:595 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:597 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:598 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:599 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:600 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:601 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:602 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:603 invalid dimen
:feature:mergeDebugAndroidTestResources FAILED

有问题的行包含 (520):

The line in question contains (520):

<item format="float" name="abc_disabled_alpha_material_dark" type="dimen">0.30</item>

希望我向您提供了足够的信息来解决问题.谢谢.

Hopefully I provided enough information to you to resolve the problem. Thank you.

推荐答案

解决方法是将您的开发机器切换到使用."的语言环境.作为小数点.

The workaround is to switch your development machine to a locale which uses "." as a decimal mark.

可以通过以下方式更改:

It can be changed the following way:

这篇关于AAPT2 编译失败:Android 3.0 Canary 1 上的无效维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:有没有一种安全的方法来管理 API 密钥? 下一篇:Gradle:如何将 Android 库发布到本地存储库

相关文章

最新文章