加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

ionic打包报错Execution failed for task ':compileDebugJav

发布时间:2020-12-17 08:23:04 所属栏目:安全 来源:网络整理
导读:添加ionic插件cordova-plugin-file可能会遇到如下报错 提示信息 :processDebugResources:generateDebugSources:compileDebugJavaapache/cordova/filetransfer/FileTransfer.java:59: error: package org.apache.cordova.file does not existimport org.apach

添加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就能打包成功了

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读