skip to Main Content
  1. Can not extract resource from com.android.aaptcompiler.ParsedResource@ef79973.
  2. Can not extract resource from com.android.aaptcompiler.ParsedResource@4c95ce87.

C:UsersUser.gradlecachestransforms-34948de165b5218454019e0897afa16eetransformedmaterial-1.6.1resvaluesvalues.xml:829:4: inner element must either be a resource reference or empty.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:mergeDebugResources’.

A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
Resource compilation failed (Failed to compile values resource file D:AndroidStudioProjectsAndroidStudioProjectsNewProjectappbuildintermediatesincrementaldebugmergeDebugResourcesmerged.dirvaluesvalues.xml. Cause: java.lang.IllegalStateException: Can not extract resource from com.android.aaptcompiler.ParsedResource@4c95ce87.). Check logs for more details.

  • Try:

Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.

BUILD FAILED in 2s

How to fix this error?

4

Answers


  1. I got the same issue because i had in string resource a ‘ character and i had to change to ‘

    Login or Signup to reply.
  2. In my case there was an issue in the strings.xml file. I had created a plurals with two items in in with the same quantity of "one". The error was resolved for me as soon as I fixed it.

    <plurals name="some_key">
      <item quantity="one">Singular</item>
      <item quantity="one">Other</item> <!-- I had repeated this quantity here -->
    </plurals>
    
    Login or Signup to reply.
  3. check your values directory,
    I got the same issue, and the problem was in themes.xml.
    You’ll find exactly where is the issue located in the build output

    Login or Signup to reply.
  4. Usually these type of errors occurred when you try to add a string or any other resource with the same name that was already exist. e.g. If you have a string resource named ‘alpha’ ABCDEF in strings.xml file and if you are trying to extract another string e.g. "aeiou" and giving the same name ‘alpha’ that was already exists then the compiler automatically generates aeiou string resource in ids.xml. Therefore when you try to build the project the above error will be occurred. So to solve this problem you should to delete a new string resource from ids.xml then you can to solve the problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search