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

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

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

  1. :processDebugResources
  2. :generateDebugSources
  3. :compileDebugJava
  4. apache/cordova/filetransfer/FileTransfer.java:59: error: package org.apache.cordova.file does not exist
  5. import org.apache.cordova.file.FileUtils;
  6. ^
  7. apache/cordova/filetransfer/FileTransfer.java:912: error: cannot find symbol
  8. FileUtils filePlugin = (FileUtils) pm.getPlugin("File");
  9. ^
  10. symbol: class FileUtils
  11. cordova/filetransfer/FileTransfer.java:912: error: cannot find symbol
  12. FileUtils filePlugin = (FileUtils) pm.getPlugin("File");
  13. :compileDebugJavaWithJavac Failed
  14.  
  15.  
  16.  
  17. FAILURE: Build Failed with an exception.
  18.  
  19.  
  20. * What went wrong:
  21. Execution Failed for task ':compileDebugJavaWithJavac'.
  22.  
  23. > Compilation Failed; see the compiler error output for details.
  24.  
  25.  
  26.  
  27. * Try:
  28.  
  29. Run with --stacktrace option to get the stack trace. Run with --info or --debugoption to get more log output.
  30.  
  31.  
  32. BUILD Failed
  33.  
  34.  
  35.  
  36. 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相关文章