简体   繁体   中英

I am getting a red variable error in my Android Studio

Error:

Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

Below screenshot

图片

It is usually Gradle version issues. If latest Gradle also does not work, make sure your application goes through Rebuilding/Clean project process. Sometimes amending the Gradle with right version doesn't work because of old cache.

In Android studio:
Build--->Clean Project or try Tools-->Android-->Sync Project with Gradle Files.
If this doesn't work look for errors in the messages box.

It seems that the problem is in the theme you picked. Go to values--->styles folder, and change your Apptheme parent to ActionBarThemeOverlay. Then find your AppTheme in the theme picker and choose it.

If you are using android studio, you have following things to be clear on::

  1. Invalidate Cache
  2. Clean and Rebuild Project (involves Syncing)
  3. Missing SDK for the platform you are using

Invalidate Cach

File > Invalidate Cache / Restart

Clean and Rebuild Project

a. Build > Clean Project b. Build > Rebuild Project

Missing SDK

  • Tools > Android > SDK Manager
  • Launch Standalone SDK Manager
  • Check the Android SDK platform you want to install and use and Install packages

Do the above in order, I guess your problem should be fixed.

PS Update Android Studio if the problem persists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM