I’m building for Android for a qt project and I get the error Exception in thread “main” java.io.FileNotFoundException

  Kiến thức lập trình

ERRORS:

Exception in thread “main” java.io.FileNotFoundException: https://github.com/gradle/gradle-distributions/releases/download/v8.8.0/gradle-8.8.0-bin.zip

at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)


at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)


at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)


at org.gradle.wrapper.Download.downloadInternal(Download.java:129)


at org.gradle.wrapper.Download.download(Download.java:109)


at org.gradle.wrapper.Install.forceFetch(Install.java:171)


at org.gradle.wrapper.Install.fetchDistribution(Install.java:104)


at org.gradle.wrapper.Install.access$400(Install.java:46)


at org.gradle.wrapper.Install$1.call(Install.java:81)


at org.gradle.wrapper.Install$1.call(Install.java:68)


at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)


at org.gradle.wrapper.Install.createDist(Install.java:68)


at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:102)


at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:66)

Building the android package failed!

— For more information, run this command with –verbose.

17:22:17: The process “C:Qt6.7.1mingw_64binandroiddeployqt.exe” exited with code 14.

Error while building/deploying project notehote5 (kit: Android Qt 6.7.1 Clang arm64-v8a)

The kit Android Qt 6.7.1 Clang arm64-v8a has configuration issues which might be the root cause for this problem.

When executing step “Build Android APK”

17:22:17: Elapsed time: 00:24.

Screenshots of android setup

FILE gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists

distributionUrl=https://services.gradle.org/distributions/gradle-8.8.0-bin.zip

networkTimeout=10000

validateDistributionUrl=true

zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

FILE build.gradle

buildscript {

repositories {


    google()


    mavenCentral()


}





dependencies {


    classpath 'com.android.tools.build:gradle:8.1.0'


}

}

repositories {

google()


mavenCentral()

}

apply plugin: ‘com.android.application’

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])


implementation 'androidx.core:core:1.10.1'

}

android {

/*******************************************************


 * The following variables:


 * - androidBuildToolsVersion,


 * - androidCompileSdkVersion


 * - qtAndroidDir - holds the path to qt android files


 *                   needed to build any Qt application


 *                   on Android.


 *


 * are defined in gradle.properties file. This file is


 * updated by QtCreator and androiddeployqt tools.


 * Changing them manually might break the compilation!


 *******************************************************/





compileSdkVersion androidCompileSdkVersion


buildToolsVersion androidBuildToolsVersion


ndkVersion androidNdkVersion





// Extract native libraries from the APK


packagingOptions.jniLibs.useLegacyPackaging true





sourceSets {


    main {


        manifest.srcFile 'AndroidManifest.xml'


        java.srcDirs = [qtAndroidDir + '/src', 'src', 'java']


        aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl']


        res.srcDirs = [qtAndroidDir + '/res', 'res']


        resources.srcDirs = ['resources']


        renderscript.srcDirs = ['src']


        assets.srcDirs = ['assets']


        jniLibs.srcDirs = ['libs']


   }


}





tasks.withType(JavaCompile) {


    options.incremental = true


}





compileOptions {


    sourceCompatibility JavaVersion.VERSION_1_8


    targetCompatibility JavaVersion.VERSION_1_8


}





lintOptions {


    abortOnError false


}





// Do not compress Qt binary resources file


aaptOptions {


    noCompress 'rcc'


}





defaultConfig {


    resConfig "en"


    minSdkVersion qtMinSdkVersion


    targetSdkVersion qtTargetSdkVersion


    ndk.abiFilters = qtTargetAbiList.split(",")


}

}

FILE gradle.properties

Project-wide Gradle settings.

For more details on how to configure your build environment visit

http://www.gradle.org/docs/current/userguide/build_environment.html

Specifies the JVM arguments used for the daemon process.

The setting is particularly useful for tweaking memory settings.

org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

Enable building projects in parallel

org.gradle.parallel=true

Gradle caching allows reusing the build artifacts from a previous

build with the same inputs. However, over time, the cache size will

grow. Uncomment the following line to enable it.

#org.gradle.caching=true

#org.gradle.configuration-cache=true

Allow AndroidX usage

android.useAndroidX=true

androidBuildToolsVersion=35.0.0

androidCompileSdkVersion=android-35

androidNdkVersion=26.1.10909125

buildDir=build

qt5AndroidDir=C:/Qt/6.7.1/android_arm64_v8a/./src/android/java

qtAndroidDir=C:/Qt/6.7.1/android_arm64_v8a/./src/android/java

qtMinSdkVersion=23

qtTargetAbiList=arm64-v8a

qtTargetSdkVersion=34

FILE local.properties

sdk.dir=C:/Users/Julia/AppData/Local/Android/Sdk

IMAGES

enter image description here
enter image description here

I tried a lot expecting to see an Emulator in qt.

New contributor

Суровый Критик is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT