当前位置: 首页 > 知识库问答 >
问题:

Ionic_Cordovaerror:在Android Studio中或在您的系统中都找不到Gradle的安装版本来安装Gradle包装器

乜裕
2023-03-14
ionic cordova add platform android


ionic cordova build android --release
cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.9
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.11.1
    npm               : 5.6.0 
    OS                : macOS High Sierra
    Xcode             : Xcode 7.2.1 Build version 7C1002 

Environment Variables:

    ANDROID_HOME : /Users/prakash/Documents/adt-bundle-mac-x86_64-20140321/sdk

Misc:

    backend : pro
ANDROID_HOME=/Users/prakash/Documents/adt-bundle-mac-x86_64-20140321/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
studio
(node:1272) UnhandledPromiseRejectionWarning: CordovaError: 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
    at Object.module.exports.check_gradle (/Users/prakash/IONIC/NABH/platforms/android/cordova/lib/check_reqs.js:150:18)
    at StudioBuilder.prepEnv (/Users/prakash/IONIC/NABH/platforms/android/cordova/lib/builders/StudioBuilder.js:216:23)
    at Api.module.exports.run (/Users/prakash/IONIC/NABH/platforms/android/cordova/lib/build.js:154:20)
    at /Users/prakash/IONIC/NABH/platforms/android/cordova/Api.js:342:43
    at _fulfilled (/Users/prakash/IONIC/NABH/platforms/android/cordova/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/Users/prakash/IONIC/NABH/platforms/android/cordova/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/Users/prakash/IONIC/NABH/platforms/android/cordova/node_modules/q/q.js:816:13)
    at /Users/prakash/IONIC/NABH/platforms/android/cordova/node_modules/q/q.js:624:44
    at runSingle (/Users/prakash/IONIC/NABH/platforms/android/cordova/node_modules/q/q.js:137:13)
    at flush (/Users/prakash/IONIC/NABH/platforms/android/cordova/node_modules/q/q.js:125:13)
(node:1272) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1272) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/Users/prakash/gradle-4.1

但还是得到了上面的消息。请帮我摆脱困境。用ADV表示感谢。

共有1个答案

裘禄
2023-03-14

我终于找到了自己问题的答案。

如果您已经安装了Android Studio并将环境变量设置为,

ANDROID_HOME : /Users/prakash/Documents/adt-bundle-mac-x86_64-20140321/sdk

然后需要下载gradle并将其包含到路径中。单击下面的链接获得手册。https://gradle.org/install

 类似资料: