問題描述
我正在使用適用于 Android 的 Instant Apps.我安裝了所有正確的軟件包,并且厭倦了創(chuàng)建具有 Instant App 支持的新應(yīng)用程序(在創(chuàng)建新應(yīng)用程序時(shí)選中了 Instant App 復(fù)選框).問題是我總是遇到編譯工具的問題.有沒有其他人有這個(gè)問題并且能夠找到任何解決方法.
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.
我的環(huán)境:
- Android Studio 3.0 Canary 1
- 編譯 SDK:25
- 構(gòu)建工具:26.0.0 rc2"
- Gradle 插件:3.0.0-alpha1
- Gradle:嘗試了 gradle-4.0-milestone1 和 2
- Java 1.8/1.7
- 操作系統(tǒng):嘗試了 Windows 10 和 Linux Ubuntu 16.4 LTS
錯(cuò)誤:
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.
推薦答案
解決方法是將您的開發(fā)機(jī)器切換到使用."的語言環(huán)境.作為小數(shù)點(diǎn).
The workaround is to switch your development machine to a locale which uses "." as a decimal mark.
可以通過以下方式更改:
It can be changed the following way:
這篇關(guān)于AAPT2 編譯失敗:Android 3.0 Canary 1 上的無效維度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!