Aqil Hex Aqil Hex - 1 year ago 232
Android Question

gradle error while try to build app using cordova

I'm using Ubuntu, and I installed Cordova successfully on my system, now im trying to build app using this command:

$ cordova build android

Before the current error, I encountered:

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

Then i tried:

$ sudo apt install gradle

It has been installed successfully

And then I'm struggling with this one:

aqil@dell:~/hello$ cordova build

/usr/lib/jvm/java-8-openjdk-amd64/bin/java: symbol lookup error: /usr/lib/jni/ undefined symbol: tgetent
Error: /usr/share/gradle/bin/gradle: Command failed with exit code 127

Can anyone please help me?

Answer Source

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

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 ''. Could not GET ''. Connect to [] 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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download