I'm using Ubuntu, and I installed Cordova successfully on my system, now im trying to build app using this command:
$ cordova build android
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
$ sudo apt install gradle
aqil@dell:~/hello$ cordova build
/usr/lib/jvm/java-8-openjdk-amd64/bin/java: symbol lookup error: /usr/lib/jni/libnative-platform-curses.so: undefined symbol: tgetent
Error: /usr/share/gradle/bin/gradle: Command failed with exit code 127
i finally could find the problem,and it was something wrong with my gradle,i first removed it with:
$ sudo apt remove gradle
because i downloaded it from the terminal,but then i downloaded it manually from the link below
unpacked it in somewhere,and inlcuded its path in my environment using this code:
$ sudo gedit ~/.bashrc
at the bottom of this page,i defined the path of gradle by this code:
export GRADLE_HOME=/home/aqil/Android/gradle-3.5 export PATH=$PATH:$GRADLE_HOME/bin
then i tried building but i encountered an error:
Total time: 9 mins 33.837 secs Error: /home/aqil/App/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'. Could not resolve all dependencies for configuration ':_debugApk'. A problem occurred configuring project ':CordovaLib'. Could not resolve all dependencies for configuration ':CordovaLib:classpath'. Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3. Required by: project :CordovaLib Could not resolve com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3. Could not get resource 'https://jcenter.bintray.com/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.7.3/gradle-bintray-plugin-1.7.3.pom'. Could not GET 'https://jcenter.bintray.com/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.7.3/gradle-bintray-plugin-1.7.3.pom'. Connect to jcenter.bintray.com:443 [jcenter.bintray.com/22.214.171.124] failed: Connection timed out (Connection timed out) Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
and i belived its connection problem,so i used tor proxy and then its worked for me,try it both with tor proxy and none,it should works for you too.