Execution failed for task ':mergeDebugResources'

利用cordova插件为APP添加启动页面cordova plugin add cordova-plugin-splashscreen

修改config.xml文件

         
        
        
        
        
        
        
        

运行APP cordova run,程序报错

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

问题所在

我在网上下载的jpg图片,然后直接改格式为png,放入启动动画的目录中

结果gradle检查了PNG的合法性,由于我改图片的格式方式比较粗暴,所以就报错了

解决办法

1.使用正规的PNG格式的图片,不能是我这种粗暴方法改成的

2.修改build.gradle文件

注意看清目录结构

aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false

这两句的作用是禁止gradle检查PNG格式图片的合法性

你可能感兴趣的:(cordova-android,cordova)