Error compiling a simple app for Android
-
Hi
I installed Qt 5.10, with Android Studio 3.0.1, jdk 1.8.0.161, sdk 26.1.1 and ndk 15.I created a simple project to run on Android for x86.
In Android Studio I set the correct proxy and port and the same I did for _JAVA_OPTIONS environment variable.When I run my application I have the following error:
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project 'android-build'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:2.2.3.
Required by:
project :
Could not resolve com.android.tools.build:gradle:2.2.3.
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.045 secs
Picked up _JAVA_OPTIONS: .....Can someone help me to solve this problem?
Using the browser I have to problem to access to https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3. - What went wrong:
-
Hi and welcome to devnet forum
AFAIK the recommendation for NDK version 10e is still valid. See below
Installing the Prerequisites
In order to use Qt for Android, you need the following:The Android SDK Tools
Note: If your Qt version is earlier than v5.9, use the SDK tools package v25.2.5 or earlier.The Android NDK (recommended version 10e)
Java SE Development Kit (JDK) v6 or later. You can also use OpenJDK on Linux.copied from here
You try downgrading your NDK
-
Thanks fro your replay.
Even if I use the NDK 10e I still have the same problem. -
@ElisaRicic said in Error compiling a simple app for Android:
A problem occurred configuring root project 'android-build'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:2.2.3.
Required by:
project :
Could not resolve com.android.tools.build:gradle:2.2.3.
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetYou have apparently a problem with the certificate.
What OS are you using for cross-compilation?
-
I'm using Win7.
-
@ElisaRicic Hi,
This solution from stack overflow solved the issue for me.
It consists to add maven repository in the gradle file, after having created a template in QtCreator project.buildscript { repositories { jcenter() maven { url "http://jcenter.bintray.com"} } //... }