找不到已安装的Gradle版本?离子v3

时间:2018-02-09 16:22:49

标签: android gradle ionic3

我已经看到有关这个问题的问题,但似乎没有一个像我的。

当我执行以下命令时,突然间,突然间,开始出现此错误:

% sudo ionic cordova run android --release

输出:

Running app-scripts build: --platform android --target cordova
[14:08:48]  build dev started ...
[14:08:48]  clean started ...
[14:08:48]  clean finished in 10 ms
[14:08:48]  copy started ...
[14:08:48]  deeplinks started ...
[14:08:49]  deeplinks finished in 379 ms
[14:08:49]  transpile started ...
[14:08:54]  transpile finished in 5.40 s
[14:08:54]  preprocess started ...
[14:08:54]  preprocess finished in 1 ms
[14:08:54]  webpack started ...
[14:08:54]  copy finished in 6.10 s
[14:09:05]  webpack finished in 10.83 s
[14:09:05]  sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[14:09:07]  sass finished in 2.13 s
[14:09:07]  postprocess started ...
[14:09:07]  postprocess finished in 18 ms
[14:09:07]  lint started ...
[14:09:07]  build dev finished in 18.98 s
> cordova run android --release
ANDROID_HOME=/Users/(whoIam)/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.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 --release (exit code 1).

但最糟糕的是,我有Gradle,在SDK和Android Studio模板中,老实说我不知道​​还能做什么,我一直试图弄清楚问题是什么,我不能做它好几天了。

这是我的环境,如果有人可以帮助我的话:

% sudo ionic info                                                                                                                                                           

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.2.1 ios 4.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.1
    ios-sim    : 5.0.12
    Node       : v7.0.0
    npm        : 5.3.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

我有Gradle:

/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
~/Library/Android/sdk/tools/templates/gradle/wrapper/gradlew

% sudo cordova requirements                                                                                                                                                 

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-27,android-26,android-25,android-24,android-23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: not installed
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

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 9.2
ios-deploy: installed 1.9.1
CocoaPods: not installed
CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/
Error: Some of requirements check failed

我是否对另一个项目(同一台机器)的要求显示gradle安装好了:

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-27,android-26,android-25,android-24,android-23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle

有些人说要安装gradle,但这没有任何意义,因为它已经安装,并且它正在工作。

它应该是关于权限的任何内容吗?我不知道还有什么建议吗?

0 个答案:

没有答案