【问题标题】:ionic 3 - Error Could not find an installed version of Gradle either in Android Studioionic 3 - 错误在 Android Studio 中也找不到安装的 Gradle 版本
【发布时间】:2018-05-20 20:31:45
【问题描述】:

我创建 ionic 3 项目并像这样添加文件和传输cordova插件,但无法使用此命令运行android ionic cordova run android --prod

Installing "cordova-plugin-file-transfer" for android Failed to install 'cordova-plugin-file-transfer': CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency. at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:581:33 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) Failed to restore plugin "cordova-plugin-file-transfer" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency. ANDROID_HOME=/Users/reactivespace/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home Error: Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio [ERROR] An error occurred while running cordova run android (exit code 1)

【问题讨论】:

    标签: android cordova plugins ionic3


    【解决方案1】:

    试试这个:

    下载最新的 Gradle 发行版here

    然后使用文件资源管理器创建一个新目录C:\Gradle

    解压此文件夹内的内容。

    之后,在系统变量下选择Path,然后点击Edit。为 C:\Gradle\gradle-4.4\bin 添加一个条目。点击确定保存。

    重新启动您的计算机,而不是再试一次。

    希望这些步骤对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2018-01-01
      • 2017-09-14
      • 1970-01-01
      • 1970-01-01
      • 2021-06-20
      • 1970-01-01
      • 2021-08-16
      • 1970-01-01
      相关资源
      最近更新 更多