Out of memory when running app with Emulator on Android studio? - android-studio

I run my app on Emulator of Android Studio 4.1.1 with exception:
../../third_party/dart/runtime/vm/zone.cc: 94: error: Out of memory.
version=2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "windows_x64"
pid=19872, thread=13300, isolate_group=main(000001D8CE0F0B60), isolate=main(000001D8CE117730)
isolate_instructions=7ff70550f230, vm_instructions=7ff70550f240
pc 0x00007ff7056a00ec fp 0x0000005f752fdff0 Unknown symbol
-- End of DumpStackTrace
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.18363.1198], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.49.0)
[√] Connected device (1 available)
I can run my app with real device.

Related

It's occure when i run flutter doctor in CMD also i have latest version of flutter ,dart and andriod studio with plugins

[√] Flutter (Channel beta, 1.22.0-12.1.pre, on Microsoft Windows [Version 10.0.17763.1397], locale en-US)
• Flutter version 1.22.0-12.1.pre at C:\src\flutter
• Framework revision 8b3760638a (2 weeks ago), 2020-09-15 17:47:13 -0700
• Engine revision 4654fc6cf6
• Dart version 2.10.0 (build 2.10.0-110.3.beta)
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 50.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[!] Android Studio
• Android Studio at /path/to/android/studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
X android-studio-dir = /path/to/android/studio
X Android Studio not found at /path/to/android/studio
• Try updating or re-installing Android Studio.
• Consider removing your android-studio-dir setting by running:
flutter config --android-studio-dir=
[√] VS Code (version 1.49.2)
• VS Code at C:\Users\Saman\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.14.1

Flutter Doctor, Android licenses status unknown

Flutter doctor says that my android license status cannot be found.
[√] Flutter (Channel stable, 1.20.3, on Microsoft Windows [Version 10.0.19041.450], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit
https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[√] Android Studio (version 4.0)
[√] VS Code (version 1.48.2)
[!] Connected device
! No devices available
I did try running flutter doctor --android-licenses
that returned me with the following error
flutter doctor --android-licenses
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
What am I missing here?
I had the same problem.
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (7 days ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale es-ES)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.57.1)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
I have achived the solution on the next way:
1.- Open a terminal window.
2.- Set the environemnt var JAVA_HOME to the path where the jdk 8 ist. in my case is:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
3.- Run the command: flutter doctor --android-licenses
Thesethree steps haven resolved my problem.
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale es-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.57.1)
[✓] Connected device (1 available)
• No issues found!
Save the value of your JAVA_HOME environment variable, then remove the JAVA_HOME environment variable if it exists.
Save the value of your jdk path. Remove your jdk from your PATH.
With those changes made, the flutter doctor --android-licenses should work.
If applicable, restore your JAVA_HOME environment variable and jdk in your path.
If that doesn't work, uninstall Android Studio and XCode, download the latest copies and reinstall.
If you can't resolve the issue, look at this thread: https://github.com/flutter/flutter/issues/28230

I want to run flutter on windows 7 with my android phone as a emulator . truned on my debugging mode. How can i fix issue of flutter doctor command

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 6.1.7601], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
[!] Android Studio (version 3.4)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.35.1)
!] Connected device
! No devices available
! Doctor found issues in 3 categories.
You have to accept licences agreement from the android SDK
You can type this command sdkmanager --licenses or navigate to your SDK folder and type tools/bin/sdkmanager --licenses.
This will ask you if you want to review non-accepeted licenses. You just have to type y to accept or n if you want to decline.
PS: Don't forget to connect your device and test debug mode with adb devices
Open VS Code, then download Dart and flutter plugin. Don't forget to implement the fix given by #user8773560

VS code and Android Studio can't find emulator

Android studio and VS code show me both no devices but flutter doctor shows no issues and the flutter run command runs the app fine
Output in Terminal:
flutter doctor -v
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 3 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/nuggetz/Programme/android/
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/nuggetz/Programme/android/
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
• No issues found!
EDIT: when i run in Android Studio Tools > Flutter > flutter doctor I get this output:
/home/nuggetz/Programme/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
• Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
• Framework revision e5b1ed7a7f (vor 4 Wochen), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio
• Flutter plugin version 34.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Process finished with exit code 0
If the status bar reads No Devices Flutter has not been able to discover any connected iOS or Android devices or simulators. You need to connect a device, or start a simulator, to proceed.
The Flutter extension automatically selects the last device connected. However, if you have multiple devices/simulators connected, click device in the status bar to see a pick-list at the top of the screen. Select the device you want to use for running or debugging.
Flutter.dev
just move all sdks from /home/nuggetz/Programme/android/ to /usr/lib/android-sdk

Flutter Finished with error: ProcessException: Permission denied

I want to run my frist app with flutter but I got the following error :
Launching lib/main.dart on Android SDK built for x86 64 in debug mode.
Initializing gradle.
Resolving dependencies.
Finished with error shown below:
ProcessException: Permission denied Command:
/home/abdoul-razak/Android/Sdk/build-tools/28.0.3/aapt dump xmltree
/home/abdoul-razak/Projects/akoybiz/build/app/outputs/apk/app.apk
AndroidManifest.xml
here is the result of flutter doctor:
abdoul-razak#Komche:~/Projects/akoybiz$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale fr_FR.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
✗ Android license status unknown.
[✓] Android Studio (version 3.0)
[✓] VS Code (version 1.30.2)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
after updating the sdk android here is the result of flutter doctor -v
abdoul-razak#Komche:~/Projects/akoybiz$ flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale fr_FR.UTF-8)
• Flutter version 1.0.0 at /home/abdoul-razak/flutter
• Framework revision 5391447fae (il y a 9 semaines), 2018-11-29 19:41:26
-0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /home/abdoul-razak/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/abdoul-razak/Android/Sdk
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
• All Android licenses accepted.
[✓] Android Studio (version 3.0)
• Android Studio at /opt/android-studio
• Flutter plugin version 23.2.1
• Dart plugin version 171.4424
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
[✓] VS Code (version 1.30.2)
• VS Code at /usr/share/code
• Flutter extension version 2.22.2
[✓] Connected device (1 available)
• itel P31 • 45YP8LSO4T7HWCLZ • android-arm • Android 7.0 (API 24)
• No issues found!
The issue is related to your Android SDK licenses. Run the command
flutter doctor --android-licenses
Then press y until it acquires all permissions.
xattr -d com.apple.quarantine ./gradlew
By using this command it solves the issue. I don't know the exact reason but it worked for me.
I stumbled across the same exception. And something fixed it, but I do not know what exactly.
The exception says something different but I think it has something to do where flutter is installed. I reinstalled it again like suggested on their website and it worked...
cd ~/development
tar xf ~/Downloads/flutter_linux_v1.7.8+hotfix.4-stable.tar.xz
Edit: Make sure you use a local folder for your flutter project too.

Resources