PingPlusPlus/pingpp-android

gradle引用pingpp-ui报错:error: style attribute '@android:attr/windowEnterAnimation' not found.

Archieeeeee opened this issue · 4 comments

根据报错信息,在官方升级gradle plugin文档中找到 https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration

Incorrect use of @ resource reference symbols
AAPT2 now throws build errors when you omit or incorrectly place resource reference symbols (@). For example, consider if you omit the symbol when specifying a style attribute, as shown below:
<item name="@android:windowEnterAnimation"/>

When building the module, AAPT2 now throws the following build error:

Error: style attribute '@android:attr/windowEnterAnimation' not found

原因是pingpp_ui/res/values/styles.xml引用了错误的“@”符号?

<style name="mystyle" parent="android:Animation">
    <item name="@android:windowEnterAnimation">@anim/dialog_enter</item>
    <item name="@android:windowExitAnimation">@anim/dialog_exit</item>
</style>

同样的问题,as3.1还不能设置aapt,已找到解决方法

@JunWeiAndroid 怎么解决的,我是在工程里定义一个同名的style,这样就会覆盖第三方库的定义了

@JunWeiAndroid 请问你是怎么解决的?

可以在 gradle.properties 中添加 android.enableAapt2=false