gogoloi
gogoloi

Reputation: 667

Errors after updating to Android 3.0 and SDK 27

After Android Studio was released to 3.0 I was forced to update my SDK from 25 to 27 (couple libraries problems).

But now when try to build my app I get next error messages:

>Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
C:\Users\Alice\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.0.aar\63ec32742d97434c1d2e0dbe96345ab9\res\values\values.xml
Error:(252, 5) error: resource android:attr/foregroundInsidePadding is private.
C:\Users\Alice\AndroidStudioProjects\Ghiduldrumetului cu Loco\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(941) resource android:attr/foregroundInsidePadding is private.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 16s
Information:7 errors
Information:0 warnings
Information:See complete output in console

Any suggestion how to fix it?

Upvotes: 1

Views: 588

Answers (3)

Izabela Orlowska
Izabela Orlowska

Reputation: 7532

Check if you're using "android:attr/foregroundInsidePadding" anywhere in your resources. It should be "attr/foregroundInsidePadding" instead.

More info: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2

Upvotes: 0

Max Yao
Max Yao

Reputation: 731

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.

Reference : https://developer.android.com/studio/build/gradle-plugin-3-0-0.html

Upvotes: 0

gogoloi
gogoloi

Reputation: 667

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

Upvotes: 1

Related Questions