我在运行ionic build android命令时遇到以下错误。我花了几个小时用谷歌搜索,但找不到任何解决方案。请大家帮忙。
FAILURE: Build failed with an exception.
What went wron Execution failed for task ':mergeDebugResources'. D:\Ionic_Workspace\MyProject_Dev\MyProject_Workspace_1.1\MyProject 1.1\platforms\and roid\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.6.1\res\drawable-t vdpi-v4\common_google_signin_btn_text_light_disabled.9.png: Error: File path too long on Windows, ke ep below 240 characters : D:\Ionic_Workspace\MyProject_Dev\MyProject_Workspace_1.1\MyProject 1.1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-b ase\9.6.1\res\drawable-tvdpi-v4\common_google_signin_btn_text_light_disabled.9.png
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l og output. Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':mergeDebugResources'. D:\Ionic_Workspace\MyProject_Dev\MyProject_Workspace_1.1\MyProject 1.1\platforms\and roid\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.6.1\res\drawable-t vdpi-v4\common_google_signin_btn_text_light_disabled.9.png: Error: File path too long on Windows, ke ep below 240 characters : D:\Ionic_Workspace\MyProject_Dev\MyProject_Workspace_1.1\MyProject 1.1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-b ase\9.6.1\res\drawable-tvdpi-v4\common_google_signin_btn_text_light_disabled.9.png
Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l og output.
最佳答案
我的 friend 验证了错误堆栈,他发现了一个问题
让我们浏览一下上面错误中提到的行,
Error: File path too long on Windows, keep below 240 characters :
所以基本上 Windows 只允许路径有 240 个字符的限制。所以他更新了项目的路径,最终我们解决了问题。希望它能帮助别人!
关于android - 运行 ionic build android 时出现 mergeDebugResources 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40018511/