Qt 6.3 unable to deploy to device (windows 10) - android-studio

I installed Qt 6.3 ,Android Studio 7 (Chipmunk 2021.2.1),java jdk-11.0.15+10 NDK Version: 22.1.7171670).The Android build Platform Sdk 32.
The jdk does not have jre.
A screenshot is attached.
I am using gradle 5.6.4
When I deploy to Android it fails with the following error log (compile output).
"
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\o\Documents\build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug\android-build\build.gradle' line: 17
What went wrong:
A problem occurred evaluating root project 'android-build'.
Failed to apply plugin [id 'com.android.internal.version-check']
Minimum supported Gradle version is 7.0.2. Current version is 5.6.4. If using the gradle wrapper, try editing the distributionUrl in C:\Users\o\Documents\build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug\android-build\gradle\wrapper\gradle-wrapper.properties to gradle-7.0.2-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 17s
Building the android package failed!
18:55:35: The process "C:\Qt\6.3.0\mingw_64\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project TrackGate (kit: Android Qt 6.3.0 Clang armeabi-v7a)
When executing step "Build Android APK"
18:55:36: Elapsed time: 06:45. "
when i change to gradle7.0.2 i get
"adb.exe: device 'DVKS100I21060300956' not found
...
Installing to device failed!
19:11:44: The process "C:\Qt\6.3.0\mingw_64\bin\androiddeployqt.exe" exited with code 16.
19:11:44: Installing the app failed with an unknown error.
...
19:11:44: The command "C:\Users\o\AppData\Local\Android\Sdk\platform-tools\adb.exe -s DVKS100I21060300956 pull /system/bin/app_process C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/app_process" terminated with exit code 1.
19:11:44: Package deploy: Failed to pull "/system/bin/app_process" to "C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/app_process
...
19:11:44: The command "C:\Users\o\AppData\Local\Android\Sdk\platform-tools\adb.exe -s DVKS100I21060300956 pull /system/bin/app_process32 C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/app_process" terminated with exit code 1.
19:11:44: Package deploy: Failed to pull "/system/bin/app_process32" to "C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/app_process".
...
19:11:44: The command "C:\Users\o\AppData\Local\Android\Sdk\platform-tools\adb.exe -s DVKS100I21060300956 pull /system/bin/linker C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/linker" terminated with exit code 1.
19:11:44: Package deploy: Failed to pull "/system/bin/linker" to "C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/linker".
...
19:11:44: The command "C:\Users\o\AppData\Local\Android\Sdk\platform-tools\adb.exe -s DVKS100I21060300956 pull /system/lib/libc.so C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/libc.so" terminated with exit code 1.
...
19:11:44: Package deploy: Failed to pull "/system/lib/libc.so" to "C:/Users/o/Documents/build-TrackGate-Android_Qt_6_3_0_Clang_armeabi_v7a-Debug/libc.so".
Error while building/deploying project TrackGate (kit: Android Qt 6.3.0 Clang armeabi-v7a)
When executing step "Deploy to Android device"
"
Assist in setting-up the environment because an android device is connected via usb.

I finally got it to deploy to device by uninstalling everything related to Qt, Java and and Android Studio. I reinstalled Qt 6.3.1 and used Qt to install Java and Android Studio .I made sure that the Arm64 v8 system image for API 30 is available in Android Studio.
This video link "https://www.youtube.com/watch?v=XrQ_j6VOnzo" helps with Qt 6 installation .
This video link "https://www.youtube.com/watch?v=WafdjRhyDRc" helps with Android Studio installation

Related

ionic cordova [ERROR] An error occurred while running subprocess

I am using the command ionic cordova build and I get the following errors and I don't find a clear answer on this. With this error I can not pass the application to android studio
cordova-plugin-androidx-adapter: Processed 14 source files in 635ms
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\andres\AppData\Local\Android\sdk (recommended setting)
ANDROID_HOME=C:\Users\andres\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Users\andres\AppData\Local\Android\sdk
FAILURE: Build failed with an exception.
What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk-17.0.4\bin\java.exe
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.
Get more help at https://help.gradle.org
Command failed with exit code 1: C:\Program Files\gradle-7.5\bin\gradle.BAT -p C:\Users\andres\Desktop\aplicacion\platforms\android wrapper -b C:\Users\andres\Desktop\aplicacion\platforms\android\wrapper.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
enter image description here
The issue might be with you java version according to the question description.
C:\Program Files\Java\jdk-17.0.4\bin\java.exe
Java 11 is supported for cordova 10+ which allows for the same minimum Android versions as cordova 9. This should now be the preferred solution.
So you need to check your ionic, cordova and java version and set it accordingly.
I hope this helps.

Build failed- Flutter

I had to reinstall my windows and so I had to freshly install Android studio, flutter sdk and everything.
After completing all my installations I am unable to run my project. Before upgrading the system my project was working all fine with 0 errors.
Flutter doctor:
C:\Users\Admin>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.959], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Android Studio (version 4.0)
[√] Connected device (1 available)
• No issues found!
Error:
Launching lib\main.dart on Mobile in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':agora_rtc_engine:extractDebugAnnotations'.
> Could not resolve all files for configuration ':agora_rtc_engine:lintClassPath'.
> Could not download kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.6.3)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.6.3/kotlin-compiler-26.6.3.jar'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.6.3/kotlin-compiler-26.6.3.jar'.
> dl.google.com
> Could not download uast.jar (com.android.tools.external.org-jetbrains:uast:26.6.3)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/26.6.3/uast-26.6.3.jar'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/26.6.3/uast-26.6.3.jar'.
> dl.google.com
> Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
> Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
> Could not GET 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
> jcenter.bintray.com
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 46s
Exception: Gradle task assembleDebug failed with exit code 1
This is the first time I am moving my project from my original system to this new one.
I don't have enough reputation to comment so I will write it as an answer. Since it is the first time running the app, make sure you have an internet connection so it can download the required files.
Solution:
As of now what I have done is the following:
agora_rtc_engine that was showing up as error I have removed it. (I will be re-adding this package as this is required for my app)
java jdk download i have added I was getting error on keytool to generate SHA1 Key Fingerprint.
I updated my SHA1 Key Fingerprint in Firebase. I have to do this as I was getting error when login in using Google sign-in.
Now my App is working fine with no errors.
This might not be the correct solution for the issue, so feel free to give your suggestion on the above error that I had faced.

Can't run 'Pub get' and can't build flutter project

On Android Studio, I clone this flutter project. When prompted if I want to create a project for the sources downloaded, I click no. Then I click "open existing project", and select the project just downloaded.
Android Studio tells me that "Pub get has not been run". So I click "Get dependencies":
C:\src\flutter\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in dicee-flutter2... 3,0s
Process finished with exit code 0
After this, the highlighting in the code is corrected, so I guess the project recognizes flutter now. But the "Pub get has not been run" prompt never disappears.
Then I run my project, in order to see it in the virtual device, but I get the following error:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
--output directory is required for assemble.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
The output of flutter doctor is:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.20.0-3.0.pre.78, on Microsoft Windows [versão 10.0.18362.356], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[√] Android Studio (version 4.0)
[√] Connected device (1 available)
• No issues found!
How to fix that, so I can see the project on the virtual device and stop getting the "Pub get has not been run" prompt?
There is a setting in AS to set the output directory. From memory it's in the file | project settings menu.
This is possibly a separate issue to the pub get problem.
You can just run flutter pub get from the cli in the projects root directory.

react-native installation in ubuntu

smackuser#smackcoders:~/Documents/projects/Awesome$ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 23.0.1
* 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: 4.562 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Go to Android SDK Manager and under tools install Android SDK Build-tools 23.0.1.
You can access SDK Manager by either typing android in your terminal or going to your android-sdk/tools directory and from there typing ./android

Build Failed : En error occurring in 'command prompt' during building ionic2 application

BUILD FAILED
Total time: 7.548 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'. >
You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 24].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
also updated sdk for the same error , but still facing the same
I have Removed android platform ($ ionic platform remove android ) and re-installed it ($ ionic platform add android ) .
after then problem was no more. got my build successfully.
Thanks for your responses all of you.

Resources