Unable to build Qt 5.9.0 with Android

872 Views Asked by At

I am facing issue while compiling Qt with android.Kindly help me to solve this issue.

issue :

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'. Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out: connect Could not resolve com.android.tools.build:gradle:2.2.3. Could not get resource 'https:// maven.google.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'. Could not GET 'https: //maven.google.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'. Connect to maven.google.com:443 [maven.google.com/172.217.26.163] failed: Connection timed out: connect

  • 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: 46.542 secs Building the android package failed! -- For more information, run this command with --verbose. 10:51:50: The process "C:\Qt\Qt5.9.0\5.9\android_armv7\bin\androiddeployqt.exe" exited with code 14. Error while building/deploying project calqlatr (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.9.0 for Android armv7)) When executing step "Build Android APK"

gradle.build:

buildscript { 
    repositories { jcenter() } 
    dependencies { classpath 'com.android.tools.build:gradle:2.2.3' } 
} 

allprojects { 
     repositories { jcenter() } 
} 
apply plugin: 'com.android.application' 
dependencies { 
   compile fileTree(dir: 'libs', include: ['*.jar']) 
} 

gradle.properties:

 androidBuildToolsVersion=26.0.0 androidCompileSdkVersion=18 buildDir=build qt5AndroidDir=C:/Qt/Qt5.9.0/5.9/android_armv7/src/android/ja‌​va 
1

There are 1 best solutions below

0
On

now it Generated apk files and able see application in emulator.

solution which worked for me :

unchecked use gradle instead of ant in Qt tools option.

unchecked Use gradle option in Qt projects(Build Android APK).