ionic build android failure - Execution failed for task processDebugResources

后端 未结 14 1856
有刺的猬
有刺的猬 2020-12-05 17:55

I am using Mac Yosemite. Getting the following failure on running a build for android platform :

FAILURE: Build failed with an exception.

* What went wrong:         


        
相关标签:
14条回答
  • 2020-12-05 18:38

    But in my case, It resolved by removing the below line

        <gap:plugin name="nl.x-services.plugins.socialsharing" />
    

    from my config.xml file

    0 讨论(0)
  • 2020-12-05 18:42

    Yes, Build successful after removing the below line

    <gap:plugin name="nl.x-services.plugins.socialsharing" />
    

    from config.xml

    0 讨论(0)
  • 2020-12-05 18:42

    For me, turned out to be the long name length of some of the images I had inside the assets folder.

    Just be aware. After deleting those images I was still getting the same error. The reason being that the images persisted inside the www folder. Deleted that folder and worked!

    0 讨论(0)
  • 2020-12-05 18:43

    Like some others, my error was caused by some terrible hidden files that were tripping gradle up.

    In my case it was the special "Icon?" file that OSX creates inside of any folder that has a custom icon (such as Google Drive, Dropbox, etc). The file is actually named "Icon\r", and I believe java/gradle is tripping up over the "\r" (or any unexpected, unescaped character).

    Solution was to nuke all the spurious "Icon?" files from my project directory:

    # note that this is the syntax for zsh. 
    # If you're using bash test out the pattern first before including '-delete'
    find ~/code/myproject/ -name Icon$'\r' -delete
    
    0 讨论(0)
  • 2020-12-05 18:46

    To get more info to debug this go in to the ./platforms/android/ folder and run:

    Mac users:

    gradlew --info build clean
    

    Linux users (thanks Pierre):

    ./gradlew --info build clean
    

    Windows users:

    gradlew.bat --info build clean
    

    This gives you a lot more detail.

    My issue was solved this way, found some files that where incorrectly dropped into the project folder with spaces in the file names.

    0 讨论(0)
  • 2020-12-05 18:52

    This issue gets resolved by adding xml namespace for phonegap (xmlns:gap="http://phonegap.com/ns/1.0") to config.xml

    After adding :

    <widget id="com.ionicframework.yourpackagename" 
    version="0.0.1" 
    xmlns="http://www.w3.org/ns/widgets" 
    xmlns:cdv="http://cordova.apache.org/ns/1.0"
    xmlns:gap="http://phonegap.com/ns/1.0">
    

    Hope it helps someone facing similar issue.

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