Linux 16.04 : Cannot cordova build (versios 6.2.2

时间:2017-06-15 09:46:28

标签: cordova ubuntu-16.04

I am trying so hard to run cordova... But i got the same exact error such as : " 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 "

Or my Path on the baschr is correct. I update Android Studio SDK with the right path on it.

But i still get this error.

I'vre read a lot of comments about it and try almost everything such as copy/paste tools android sdk (downloaded on the android site ) into my path folder with no success at all.

What shall i do ?

Thank you !

2 个答案:

答案 0 :(得分:1)

问题解决了。

事实上,我只是使用以下命令手动安装了gradle:

sudo apt-get install gradle

它似乎工作!

答案 1 :(得分:0)

Gradle files are present in Android SDK. Your Android SDK is missing (atleast the path could not be found). Do install Android SDK and place the path in PATH in System Environment Variables.

Reference here - Android Builds Now Using Gradle By Default.

If you have Android SDK installed already, Check How To Read and Set Environmental Variables on a Linux for more details.

Check this Configuring Gradle documentation.

If you dont have Android SDK, then refering to this answer,

  • Visit the Downloads Page of Android and SDK Tools
  • Download Android command line tools given at the bottom of the page. You need not install Android Studio.
  • Then set environment variables accordingly.
  • Then In project folder:

    $cordova platforms remove android
    $cordova platforms add android