'Execution failed for task ':app:processDebugResources'. failed to execute aapt

In Android Studio I have this error when I update Android SDK Tools to version 25:

enter image description here

I tried to modify SDK version in gradle build to 21 to execute my app but I have this error. Really I don't why this happens. This is my build.gradle file:

enter image description here

Thanks a lot for your help!



Solution 1:[1]

Update your build tools, and the error will be fixed automatically.

Solution 2:[2]

I have same issue before seeing this post i solved it by exiting android studio and running it with administrative privilege

Solution 3:[3]

I was getting this after adding google maps. It turned out being a missing key reference

Error:(45) resource string/google_maps_key (aka com.your.package:string/google_maps_key) not found.
Error:(45) error: resource string/google_maps_key (aka com.your.package:string/google_maps_key) not found.
android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml

In the manifest. Which needed to be added in the build.gradle script as showin in https://developers.google.com/maps/documentation/android-api/map-with-marker. After adding the following to build.gradle

  resValue "string", "google_maps_key",
          (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")

The aapt error went away.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dat Nguyen
Solution 2 Samuel Moshie
Solution 3 frmdstryr