Error trying to build app
-
I 'm trying to build my app and I get this error:
:-1: error: Build failed with an exception.
-
Where:
Build file 'G:\Eggrafa\QtProjects\Android\build-Inventory_1_1-Android_Qt_6_2_3_Clang_x86-Debug\android-build\build.gradle' line: 17 -
What went wrong:
A problem occurred evaluating root project 'android-build'.
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
:-1: error: - changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changingorg.gradle.java.home
ingradle.properties
.- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
With the CMD, in dir android-build (G:\Eggrafa\QtProjects\Android\build-Inventory_1_1-Android_Qt_6_2_3_Clang_x86-Debug\android-build), I tried :
gradlew --version
and got this:
JVM 1.8.0_322 (Red hat ...
How can I fix it?
-
-
I installed JDK.
In Tools > Options > Devices > Android at 'JDK Location' I put the path C:\Program Files\Java\jdk-17.0.2.
I restarted Qt Creator and now I get a differrent error:- What went wrong:
Execution failed for task ':processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:G:\Eggrafa\QtProjects\Android\build-Inventory_1_1-Android_Qt_6_2_3_Clang_x86-Debug\android-build\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:21: AAPT: error: attribute android:allowNativeHeapPointerTagging not found.
ERROR:G:\Eggrafa\QtProjects\Android\build-Inventory_1_1-Android_Qt_6_2_3_Clang_x86-Debug\android-build\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:21: AAPT: error: attribute android:requestLegacyExternalStorage not found.
- What went wrong: