Execution failed for task ':app:processDebugResources' even with latest build tools

前端 未结 10 1893
南笙
南笙 2020-12-03 05:14

I am getting this error when I try to run my project. I have installed the latest build tools- 23.0.3 but still the error persists. How do I fix this?

Execut         


        
相关标签:
10条回答
  • 2020-12-03 05:54

    I changed the target=android-26 to target=android-23

    project.properties

    this works great for me.

    0 讨论(0)
  • 2020-12-03 05:54

    After updating my Android SDK I stumbled upon this very problem and I tried many ways without success. What was most irritating to me when searching for a fix, were the lots of answers suggesting to change the CompileSdkVersion to a certain number while obviously this number changes with time, so here's what I did instead.

    I created a new project and ran it on the emulator to make sure it's working, then checked its "\android\app\build.gradle" file and copied the numeric value of CompileSdkVersion and pasted into the same file in my other project that could not be built properly anymore. Now my problem's gone. Hope that helps.

    0 讨论(0)
  • 2020-12-03 05:57

    Error:Execution failed for task com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:

    finished with non-zero exit value 1

    One reason for this error to occure is that the file path to a resource file is to long:

    Error: File path too long on Windows, keep below 240 characters 
    

    Fix: Move your project folder closer to the root of your disk

    Don't:// folder/folder/folder/folder/very_long_folder_name/MyProject...

    Do://folder/short_name/MyProject


    Another reason could be duplicated resources or name spaces

    Example:

      <style name="MyButton" parent="android:Widget.Button">
          <item name="android:textColor">@color/accent_color</item>
          <item name="android:textColor">#000000</item>
      </style>
    

    And make sure all file names and extensions are in lowercase

    Wrong

    myimage.PNG
    myImage.png
    

    Correct

    my_image.png
    

    Make sure to Clean/Rebuild project

    (delete the 'build' folder)

    0 讨论(0)
  • 2020-12-03 06:00

    this issue comes up with 2 reasons

    1) the android SDK has not been install 2) the build toold version corresponsind to the android SDK is not installed

    to start open terminal and type android and install API 26(updated one) and build tools version 26.0.1 or 26.0.2 then try to run using command ionic cordova build android

    0 讨论(0)
提交回复
热议问题