Android Studio crashes in Mac OS Monterey Beta 6 - android

So I recently updated my MacBook Air M1 chip to the latest version of Mac OS Monterey and suddenly my Android Studio started crashing because of which I can't connect my emulator or use Flutter with it. Can someone help me with it?
Here are my logs -
Process: studio [53499]
Path: /Volumes/VOLUME/*/Android Studio.app/Contents/MacOS/studio
Identifier: com.google.android.studio
Version: 2020.3 (AI-203.7717.56.2031.7678000)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2021-09-15 13:29:43.4753 +0530
OS Version: macOS 12.0 (21A5506j)
Report Version: 12
Anonymous UUID: 5ACCD76D-EE29-30BD-078E-17070264723F
Sleep/Wake UUID: 23925D3A-0748-4C60-B3F3-19C83A953526
Time Awake Since Boot: 1000 seconds
Time Since Wake: 271 seconds
System Integrity Protection: enabled
Crashed Thread: 3
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000400000000
Exception Codes: 0x0000000000000001, 0x0000000400000000
Exception Note: EXC_CORPSE_NOTIFY
VM Region Info: 0x400000000 is not in any region. Bytes after previous region: 6796312577 Bytes before following region: 14763950080
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
unused shlib __TEXT 26791e000-26ae88000 [ 53.4M] r--/r-- SM=COW ... this process
---> GAP OF 0x505178000 BYTES
VM_ALLOCATE (reserved) 770000000-778000000 [128.0M] rw-/rwx SM=NUL ...(unallocated)
Application Specific Information:
abort() called
The entire thing is quite long, but these are the top few lines. Any suggestions?

I had the same problem and upgrading to monterey beta 7 solved the issue I hope it does for you too.

In my own case, I got a prompt to update my Android studio after switching to Mac OS Monterey. Before downloading the update, I selected the wrong processor (Apple/Intel) and that was why my Android Studio was crashing on installation.
I hope this helps someone out there.
To check your processor type, click on the Apple logo on the top left corner of your Mac and select the first menu option that appears: About this Mac, the appropriate processor type would be displayed.

Related

AVD with Android studio 4.1.1 crashing on mac OS High Sierra with error "qemu-system-x86_64 quit unexpectedly"

I did a fresh install of latest Android studio on my mac os High sierra, there was no previous version of Android studio on the laptop. AVD keeps crashing when I try to run a basic code.
Attached is the error snapshot, I tried different workarounds listed in different threads, tried command line, tried to just invoke avd, still the same error. Has Android 11, 10 installed.
Below is the error
Process: qemu-system-x86_64 [2406]
Path: /Users/USER/Library/Android/*/qemu-system-x86_64
Identifier: qemu-system-x86_64
Version: 0
Code Type: X86-64 (Native)
Parent Process: studio [2380]
Responsible: qemu-system-x86_64 [2406]
User ID: 501
Date/Time: 2020-11-21 13:24:24.625 -0800
OS Version: Mac OS X 10.13.6 (17G14042)
Report Version: 12
Anonymous UUID: 3F92D280-01FC-0232-0678-BB15A8C21C4E
Sleep/Wake UUID: DC22FDA6-D97B-44DD-9541-89BE58B903F9
Time Awake Since Boot: 5300 seconds
Time Since Wake: 960 seconds
System Integrity Protection: enabled
Crashed Thread: 10
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray'
abort() called
terminating with uncaught exception of type NSException
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff297edf3b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff50b46942 objc_exception_throw + 48
2 CoreFoundation 0x00007fff298079ed -[__NSArray0 objectAtIndex:] + 93
3 libMoltenVK.dylib 0x000000011e9ef8a7
Error
I had the exact same problem and I solved it by disabling the hardware graphics rendering.
Edit the configuration of your virtual device in AVD manager, select "Show advanced settings" and then select "Software - GLES 2.0" in the option list for graphics.
Note that it is only a work-around, not a real solution because now the emulator will run but very very slowly.
changing the option for graphic rendering in AVD manager

Android Studio Emulator: Process finished with exit code 3 [duplicate]

I have been messing around with android studio and I ended up installing cocos2dx and using an arm cpu emulator to work with cocos2dx. I have recently seen a message prompting for an update for the android emulator service so I installed it and now my emulator crashes while trying to boot and gives this error in the logcat - this is the error it gave me
19:36 Emulator: **
19:36 Emulator: ERROR:/buildbot/src/android/emu-3.0-release/external/qemu/fpu/softfloat.c:486:round_canonical: code should not be reached
19:36 Emulator: Warning: QObject::~QObject: Timers cannot be stopped from another thread ((null):0, (null))
19:36 ADB rejected shell command (getprop): closed
19:36 Emulator: Process finished with exit code 3
I have no idea what this means but I know it has something to do with the update I downloaded, is there any way to roll back the update maybe?
I've come across the same issue on Windows 10: the current version of Android Emulator (Nov 14, 2018: 28.0.16) crashes or freezes as soon as a virtual ARM device is started. When I start it from command line, it prints
Emulator:
ERROR:/buildbot/src/android/emu-3.0-release/external/qemu/fpu/softfloat.c:486:round_canonical:
code should not be reached
As a temporary solution, I downgraded the emulator to an older version and the problem disappeared.
Here you can find Android Emulator 27.2.9:
Windows: https://dl.google.com/android/repository/emulator-windows-4773671.zip
Mac: https://dl.google.com/android/repository/emulator-darwin-4773671.zip
Linux: https://dl.google.com/android/repository/emulator-linux-4773671.zip
Steps to downgrade the emulator:
Stop all instances of the emulator and close Android Studio;
Open Android SDK directory. Its location can be found in the settings: Android Studio->File->Settings->Appearance & Behavior->System Settings->Android SDK->Android SDK Location;
Move existing 'emulator' directory somewhere outside of Android SDK (if you just rename and leave it there, AVD Manager will find it and start using again);
Unpack one of emulator-*-4266726.zip into the SDK directory;
Launch Android Studio and don't update Android Emulator until it's fixed.
Related answer: How to downgrade Android Emulator
I've come across the same issue on Windows 10,I upgrade Android Emulator 28.0.16 to 28.0.20 also solve the error.

qemu-system-i386 quit unexpectedly when starting AVD (Android Virtual Device) on a Mac (illegal instruction 4)

I installed Android Studio on my Mac (Macbook Pro, August 2017, OSX 10.12.4), then started up, created a hello world project and created an AVD (Android Virtual Device, Nexus 5) to run my project on it.
The error shows when I try to run my project on the simulator (pressing the play button) or when I try to start up the emulator itself.
Here's a screenshot of the error:
Here's the beginning of the stack trace:
Process: qemu-system-i386 [5779]
Path: /Users/USER/Library/Android/*/qemu-system-i386
Identifier: qemu-system-i386
Version: 0
Code Type: X86-64 (Native)
Parent Process: studio [4683]
Responsible: qemu-system-i386 [5779]
User ID: 502
Date/Time: 2017-08-22 13:20:02.612 +0100
OS Version: Mac OS X 10.12.4 (16E195)
Report Version: 12
Anonymous UUID: A816A6BA-C97F-6831-E59F-1431A005F23C
Sleep/Wake UUID: 48F2FC89-DF11-4A13-ACEB-E81AF10174B0
Time Awake Since Boot: 15000 seconds
Time Since Wake: 7900 seconds
System Integrity Protection: enabled
Crashed Thread: 4
Exception Type: EXC_CRASH (SIGILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: qemu-system-i386 [5779]
And here is the full stack trace: https://pastebin.com/raw/Btt2igX4
Disabling / Uninstalling CylancePROTECT solved this issue for me.
sudo launchctl remove com.cylance.agent_service
The same software was also preventing me from compiling go programs.
Some memory protection is at the source of the problem. Here is the relevant article for some fine tuning of CylancePROTECT that could resolve the issue with uninstalling completely the software: runtime: bsdthread_register fatal error (CylancePROTECT)
I solved it by go to ADV manager -> Select Virtual Device -> edit icon -> Select Graphics to Software GELS-2.0

Android VM crashes on Launch Mac

I have a problem.
I've been working with Android in Eclipse for the past 4-5 weeks now and never had a problem with the VM (they were slow, yes. But never crashed).
Now, I believe since 4.2 when I started working on a new project for uni (deadline next week) my 4.2 VM suddently starts crashing on launch, because of "Kernel Panic" (resport at the end).
I wanted to ask if there is anything I could do, maybe download a hotfix or anything. Both the API and Eclipse are pretty much up to date or might there be something wrong with my computer?
(Somehow even my old VMs (2.3.3, 3.1 and 4.1) crash on launch 99% of the time)
Any advice would be highly appreciated. Here the beginning of the Crash-Log:
Process: emulator64-arm [1334] Path:
/Users/USER/*/emulator64-arm Identifier: emulator64-arm Version:
??? Code Type: X86-64 (Native) Parent Process: eclipse [1156]
User ID: 501
Date/Time: 2012-12-01 00:25:27.469 +0100 OS Version: Mac OS
X 10.8.2 (12C2034) Report Version: 10
Interval Since Last Report: 130686 sec Crashes Since Last
Report: 96 Per-App Crashes Since Last Report: 32 Anonymous
UUID: ABE51F99-F7A9-2595-016E-C47FFD1F6C50
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x0000000000000000
VM Regions Near 0:
-->
__TEXT 0000000100000000-0000000100247000 [ 2332K] r-x/rwx SM=COW /Users/USER/*
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
Do you have two screens? if yes, did you launch avd/vm on secondary screen last time?
If yes, then check config vm file at:
cd ~/.android/avd/
ls -la => here you see all avds
cd [your_vm.avd]
joe emulator-user.ini => edit this config file and see value
window.x = 2054 - this is stupid value, cause says where to display emulator window. Value is set cause emulator window was displayed at second screen on x position 2054 but as I say it's bug at avd. Simply change it to better value to display window at your main screen so like my case:
window.x = 954
window.y = 199
uuid = 1342941165631
Save config file, start eclipse, start your avd/vm and all must run well.
It looks like this happens when an external monitor is connected. Try disconnecting your external monitor and then start emulator. You can attach it back after the emulator starts.
I had the same problem. Yesterday it worked fine. Today crashes with EXC_BAD_ACCESS. Then I noticed that the audio I was listening to stopped for half a second when launching the AVD. I though that might have something to do with it. I stopped iTunes I was listening to, restarted the AVD and yes success. No crash, it started up nicely.

OSX: Android Emulator Crashes

I've just reinstalled eclipse indigo (32bit) and the latest Android SDK. The Android Emulator crashes immediately after it is launched.
Here are my steps:
Create a new Adroid project. Target is Android 4.0, SDK 14.
Press the Run button in Eclipse.
See the Emulator launch and crash about 2 seconds later
Output of crash window:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
The Eclipse console complains about the following:
Warning once: This application, or a library it uses, is using NSQuickDrawView,
which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
goldfish_fb_load: framebuffer dimensions mismatch
savevm: unable to load section goldfish_fb
emulator-5554 disconnected!
Cancelling 'com.sparky1.HelloAnrdroidActivity activity launch'!
Any thoughts about how to get emulator to behave?
This has already been reported as a Bug: http://code.google.com/p/android/issues/detail?id=724
There are some workarounds presented in this post, too. But at this point, there seams to be no actual fix.
It looks like this happens when an external monitor is connected. Try disconnecting your external monitor and then start emulator. You can attach it back after the emulator starts.
I've seen this problem too. I've found that running emulator from command line and disabling snapshots help a lot.
I'm running:
$ emulator -no-snapshot-load #avd
If disable snapshot when create device, ok. Do not enable snapshot.
If enable snapshot, it's ok to check "save to snapshot" when launch device.
But check "launch from snapshot" is not ok. If already save snapshot, it will cause emulator-arm crash.
After emulator-arm crash by "launch from snapshot", disable snapshot with AVD manager does not work. But run config > target > additional command line option(-no-snapshot-load) works.
I had all these crashes as well and found this in my crash logs:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.CoreFoundation 0x97585bc1 CFStringGetLength + 17
1 com.apple.CoreFoundation 0x9759df63 CFStringCompareWithOptionsAndLocale + 35
2 com.apple.CoreFoundation 0x9759df2c CFStringCompare + 60
3 com.b-l-a-c-k-o-p.CamCamX5 0x03ff3b44 CoreBundleyes::IsMainMember() const + 48
4 com.b-l-a-c-k-o-p.CamCamX5 0x03ff11cc QVDigBaseClass::ClassFactory(ComponentInstanceRecord*) + 50
5 com.b-l-a-c-k-o-p.CamCamX5 0x03ff317b QVDIG_DATA_Open + 23
After spending only a couple of hours :-( on the net I found a tip to remove
/Library/Quicktime/CamCamX5.component
After that no more crashes :-)
An alternative is to switch to using AndroVM in Virtual Box which is an X86 Android image. The big advantage is that it is lightning fast compared to the ARM one. It boots in 2-3 secs. The downside is that you have to manually do the ADB connection and the capturing of the mouse by virtual box is a pain. Not all applications will run on the x86 as well.
To use it you have to configure the first Ethernet adapter as Host Only, run the androVM configuration utility to get the emulator's IP address, then use adb connect ip-address
Another tip is that if the screen times out you need to hit F1 to wake it up.

Categories

Resources