Skip to content Skip to sidebar Skip to footer

Ionic (+cordova,android.sdk,gradlew) Execution Failed For Task

(my problem was related to ionic, and it is common problem here, it is caused by using cordova and android.sdk, so I am adding these flags too) I had problem running [ionic run and

Solution 1:

At the start you can try other, faster fixes:

Try to update cordova (and Ionic)

If you aren't using the ionic, remove ionic from command.

npm update cordova ionic or if it is globally npm update -g cordova ionic

How to debug it:

Try to find the gradlew. (for Windows) gradlew.bat, (for Unix'ies) gradlew (dot something I guess - comment me please)

Ionic (Windows): project_name/platforms/platform(android)/gradlew.bat (example: C:\workspace\Caparol\platforms\android\gradlew.bat)

Other system/framework? Add an edit/comment.

(I am using the git bash, I am not sure if that works in pure cmd on Windows, it should work in any Unix terminal)

Go to the platform_name directory, that contains your gradlew file.

Process ./gradlew_file assembleDebug --info (example ./gradlew.bat assembleDebug --info) or/and ./gradlew_file --info build clean (example ./gradlew.bat --info build clean)

In output you got more detailed information than using --stack-trace or --info or --debug in usual build command.

Invalid path

C:\workspace\project_name\platforms\android\build\intermediates\assets\debug\www\dir\Zdj▒cia: error: Invalid directory name, unable to add.

And fix not valid characters in path - dont use national characters.

Then - fix it in your project and build/intermediates folder. (or delete build/intermediates)

Lint error

You can get problems like

Execution failed for task ':CordovaLib:lint'. Lint found errors in the project; aborting build.

for example I got:

Execution failed for task ':CordovaLib:lint'.

android {
  lintOptions {
    abortOnError false
  }
}

Fix it to valid file_type syntax.

More cases? Comment me please.

Post a Comment for "Ionic (+cordova,android.sdk,gradlew) Execution Failed For Task "