ionic 3 - 错误无法在Android Studio

时间:2017-12-06 20:41:33

标签: android cordova plugins ionic3

我创建离子3项目并添加文件并传输这样的cordova插件,并且无法使用此命令运行android离线cordova运行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)

1 个答案:

答案 0 :(得分:1)

试试这个:

下载最新的Gradle分发here

然后使用文件浏览器创建一个新目录 C:\ Gradle

解压缩此文件夹中的内容。

之后,在系统变量下选择路径,然后点击修改。为 C:\ Gradle \ gradle-4.4 \ bin 添加条目。点击确定进行保存。

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

希望这些步骤可以帮到你。