how to solve the assemble debug issue.? - android-studio

Launching lib\main.dart on Redmi Note 5 Pro in debug mode...
Running Gradle task 'assembleDebug'...
Exception: Gradle task assembleDebug failed with exit code -1
this is the error showing in the run log when im trying to run the demo flutter codes.

Related

Qt 6.3 unable to deploy to device (windows 10)

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

Debug flutter app throws out of memory error

whenever I debug a simple flutter app, it always throws - out of memory error with below logs. I'm using Android Studio 4.0, Flutter 1.17.2, and Java 8.
If I run the Gradle task assembledebug from the command line it builds successfully.
I've set org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options="-Xmx1024M" -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 in gradle.properties. It drives me crazy , Please help
Logs:
Running Gradle task 'assembleDebug'...
|c:\b\s\w\ir\cache\builder\src\third_party\dart\runtime\vm\zone.cc: 90: error: Out of memor y. version=2.8.3 (stable) (Tue May 26 18:39:38 2020 +0200) on "windows_x64"

Error connecting to the service protocol: failed to connect to http://127.0.0.1:41209/y-F2GYjV9_Y=/

Whenever I try to flutter run I get this error:
amein#amein:~/Documents/taywan$ flutter run
Launching lib/main.dart on SM A107F in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 43.3s ✓
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 26.2s
Error connecting to the service protocol:
failed to connect to http://127.0.0.1:41209/y-F2GYjV9_Y=/
That happened with me just a few minutes ago and I solved it by following two steps:
$flutter clean
$flutter upgrade
Try doing these two commands on the command line in your IDE whether it is <> or <>.

:app:recordFilesBeforeBundleCommandDebug FAILED

Hello I am trying to run an application react-native on a remote desktop
when I run ./gradlew clean it is build successfully.
However I have an error when running ./gradlew assembleDebug
Error: ENOENT: no such file or directory, open 'C:\Users\user\AppData\Local\Temp;C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe\CodePushResourcesMap-aab77707.json'
:app:recordFilesBeforeBundleCommandDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'.
> Process 'command 'node'' 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.
BUILD FAILED
Total time: 10 mins 1.501 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
Redirect to android folder and then use gradlew clean.
1.cd android
2.gradlew clean
I resolved this issues by using this comment

Android Studio Project Run Issue

I have successfully imported Eclipse Project into Android Studio. I have added library projects as modules to that project. Gradle build is also successful but when I run app, it says "Gradle build finished with 1 error(s) in 23 sec" and error is :
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_21\bin\java.exe'' finished with non-zero exit value 2
Any solution to this problem?
I am using Android Studio v1.1.0
This error occurs when the project has not been refreshed (Clean and Build) after adding libraries.To resolve it just CLEAN and it will run.

Resources