我正在为 Android 构建 qt 项目,并且在线程“main”java.io.FileNotFoundException 中收到错误异常

问题描述 投票:0回答:1

错误:

线程“main”中的异常 java.io.FileNotFoundException: https://github.com/gradle/gradle-distributions/releases/download/v8.8.0/gradle-8.8.0-bin.zip

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

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

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

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

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

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

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

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

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

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

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

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

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

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

构建 android 包失败!

-- 有关更多信息,请使用 --verbose 运行此命令。

17:22:17: The process "C:\Qt\6.7.1\mingw_64\bin\androiddeployqt.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.

文件 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

文件 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(",")


    }


}

文件 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

文件本地.properties

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

图片

在此输入图像描述 在此输入图片描述

我尝试了很多,希望在 qt 中看到模拟器。

android qt android-emulator
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.