ionic打包报错Execution failed for task ':compileDebugJavaWithJavac'.

前端之家收集整理的这篇文章主要介绍了ionic打包报错Execution failed for task ':compileDebugJavaWithJavac'.前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

添加ionic插件cordova-plugin-file可能会遇到如下报错

:processDebugResources
:generateDebugSources
:compileDebugJava
apache/cordova/filetransfer/FileTransfer.java:59: error: package org.apache.cordova.file does not exist
import org.apache.cordova.file.FileUtils;
                              ^
apache/cordova/filetransfer/FileTransfer.java:912: error: cannot find symbol
                        FileUtils filePlugin = (FileUtils) pm.getPlugin("File");
                        ^
  symbol: class FileUtils
cordova/filetransfer/FileTransfer.java:912: error: cannot find symbol
                        FileUtils filePlugin = (FileUtils) pm.getPlugin("File");
                        
 :compileDebugJavaWithJavac Failed



FAILURE: Build Failed with an exception.


* What went wrong:
Execution Failed for task ':compileDebugJavaWithJavac'.

> Compilation Failed; see the compiler error output for details.



* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output.


BUILD Failed



Total time: 6 mins 51.314 secs

如果你在ionic cordova platform add android时,有注意到cordova-plugin-file是需要cordova-android版本大于等于6.3.0

所以只需要运行命令ionic cordova platform remove android ionic cordova platform add android@6.3.0这样就在运行ionic build就能打包成功了

猜你在找的Angularjs相关文章