1. 程式人生 > >[Android] foregroundInsidePadding is private

[Android] foregroundInsidePadding is private

因為有使用到 cardslib,所以升級到 Gradle 3.0.0 之後會出現 Error:

android:attr/foregroundInsidePadding is private

解法:

adding android.enableAapt2=false to gradle.properties file.

Try disabling the AAPT2 by adding android.enableAapt2=false to your gradle.properties file.

Builds may fail while AAPT2 is enabled. Additionally, AAPT2 is currently not compatible with Robelectric. If your build fails due to an AAPT2 resource processing issue or you want to use Roboelectric, you can disable AAPT2 by setting android.enableAapt2=false in your gradle.properties file and restarting the Gradle daemon by running ./gradlew –stop from the command line.

如果找不到這一個檔案,可以開一個新的 Android project 就可以拿到了,再 copy / paste  進舊的 project 裡即可。

記得 gradle 版本記得要使用跟新 android project 一樣的設定。