Ionic(+ cordova,android.sdk,gradlew)任务执行失败< task_name> [英] Ionic (+cordova,android.sdk,gradlew) Execution failed for task <task_name>
问题描述
(我的问题是与离子,这是常见的问题,这是由使用cordova和android.sdk,所以我也添加了这些标志)
我有问题运行[ ionic run android [-lc]
, ionic build android
]在ios或其他命令,并通过此答案 - 评论请求解决)
任务'processDebugResources'的执行失败。
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:Process'command
'C:\Android_SDK\build- tools\24.0.1\aapt.exe完成了非零退出值
说实话,你可以调用
任务执行失败。
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:Process'command
'C:\Android_SDK\build- tools \24.0.1 \aapt.exe完成非零退出
p>开始时,您可以尝试其他更快速的修正:
-
任务执行失败:processDebugResources [Cordova / Ionic] (实际上它涵盖了我的答案,但缺乏调试和修复更深层的问题)
尝试更新cordova(和Ionic)
如果您不使用离子,请从命令中删除 ionic
。
npm update cordova ionic
或如果全球 npm update -g cordova ionic
如何调试它:
尝试找到 gradlew
。
(对于Windows) gradlew.bat
(对于Unix'ies) gradlew
- 请评论我)
: project_name / platforms / platform (android)/gradlew.bat
(例如: C:\workspace\Caparol\platforms\android\gradlew.bat
)
/ framework?添加编辑/评论。
(我使用的是git bash, cmd在Windows上,它应该在任何Unix终端中工作)
转到包含您的gradlew的 platform_name
目录文件
处理 ./ gradlew_file assembleDebug --info
(示例 ./ gradlew。 bat assemblyDebug --info
)或/和 ./ gradlew_file --info build clean
(示例 ./ gradlew.bat --info build clean
)
在输出中你得到比使用在常用构建命令中使用code>或
- info
或 - debug
无效路径
C:\workspace\project_name\platforms\\ \\android\build\intermediates\assets\debug\www\dir\Zdj▒cia:错误:无效的目录名称,无法添加。
然后 - 修复它在您的项目和构建/中间
文件夹。 (或删除 build / intermediates
)
Lint错误
您可以得到像
的问题任务'CordovaLib:lint'的执行失败。
Lint发现项目中的错误;正在中止生成。
例如,我得到:
任务':CordovaLib:lint'的执行失败。
android {
lintOptions {
abortOnError false
}
}
修复它有效的file_type语法。
更多的情况?请给我留言。
(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 android [-lc]
, ionic build android
] (if you got it in ios or other commands, and it is solved by this answer - comment please)
Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command 'C:\Android_SDK\build-tools\24.0.1\aapt.exe'' finished with non-zero exit value
To be honest, you can call it
Execution failed for task . com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command 'C:\Android_SDK\build-tools\24.0.1\aapt.exe'' finished with non-zero exit
At the start you can try other, faster fixes:
Execution failed for task :processDebugResources [ Cordova / Ionic ] (actually it covers answer to mine, but there is lack of debugging and fixing deeper problems)
ionic build android failure - Execution failed for task processDebugResources
Error:Execution failed for task , finished with non-zero exit value 1
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.
这篇关于Ionic(+ cordova,android.sdk,gradlew)任务执行失败< task_name>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!