Android Studio Emulator Error Using AVD - android-studio-3.0

I've been running Studio 3.0.1 for a few weeks. My project was working fine with the emulator and AVD. The next day, the first time I re-tried the emulator I got:
Emulator: emulator: ERROR: can't find the emulator executable
Emulator: Process finished with exit code -1
I have deleted and rebuilt a couple of different AVD devices, I checked that HAXM is running and my environment/system PATH variables are:
c:\Users\***\AppData\Local\Android\sdk\emulator
c:\Users\***\AppData\Local\Android\sdk\platform-tools
c:\Users\***\AppData\Local\Android\sdk\tools
I then connected a Galaxy S7 running Nougat and the emulator runs fine!
Further investigation shows that when I run the emulator from the terminal:
C:\Users\***\AppData\Local\Android\sdk\tools>emulator -avd Samsung_Galaxy_S7_API_24
I get:
Could not launch 'C:\Users\DHJ\AppData\Local\Android\sdk\tools..\emulator\qemu\windows-x86_64\qemu-system-i386.exe': No such file or directory
And when I run it from a different folder (why are there 2 locations for the emulator?):
C:\Users\***\AppData\Local\Android\sdk\emulator>emulator -avd Samsung_Galaxy_S7_API_24
I get:
emulator: ERROR: can't find the emulator executable.
Any ideas on how I can AVD working again?

I solved this by downgrading the emulator using the reply from:
How to downgrade Android Emulator

Related

“adb devices” detect my device but not Appium server, why?

Environment:
Windows 10
Python 3.7.9
Appium 1.22.3
Node v12.15.0
Android Debug Bridge version 1.0.41
Version 33.0.2-8557947
Sdkmanager 4.0.1
Appium-Python-Client==2.4.0
Problem:
Appium doesn't detect my device:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Device E531XE1ZM11302266 was not in the list of connected devices
at getResponseForW3CError (C:\Users\gauth\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\gauth\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
So I run the command "adb devices" which shows correctly my device.
Is there any process to fix this kind of issue please? How could I fix that?

Failed to execute adb.exe when trying to run Xamarin.UITest

I'm trying to setup a Xamarin UITest without any luck.
When I try to run 'all tests', I get the following error:
execute: C:\Users\Brandon\AppData\Local\Android\android-sdk\platform-tools\adb.exe devices - exit code: 1
error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
List of devices attached
adb server version (39) doesn't match this client (36); killing...
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
ADB seems to be started just fine and the weird thing is that it seems to be using an adb version from another user, even though..
1) Tools > Options > Xamarin > Android is set to different path than the above-mentioned, for the Android SDK.
2) There is no system environment path variable that I can find for the above-referenced adb.exe path!
Am I missing something?
In my case it was Android Emulator version mismatch. Somehow Emulator got updated to the newer version:
After uninstalling Emulator, switching Feed to Microsoft instead of google and re-installing Emulator - error was gone and everything worked just fine.

Jenkins Android Emulator Plugin not running

I am trying to explore and use the Jenkins Android Emulator plugin in order to run my emulator within a CI environment. I have so far tried 3 different methods but none of them is able to run the emulator
Method 1:Using an existing emulator
Screenshot of the first method
In the job's configuration , Select Run an Android emulator during build, then Run existing emulator. In the AVD name I insert Nexus5X_6_8664 then Jenkins is able to find it.
When i run the job it gives me the following error :
Started by user Amine
Building in workspace D:\jenkins\workspace\Emulator
[android] Using Android SDK: D:\Tools\Dev\sdk\
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe start-server
* daemon not running. starting it now at tcp:5857 *
* daemon started successfully *
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe start-server
[android] Starting Android emulator
$ D:\Tools\Dev\sdk\/tools/emulator.exe -engine classic -ports 5768,5769 -report-console tcp:5833,max=60 -avd Nexus5X_6_8664 -no-snapshot-load -no-snapshot-save
init: Could not find wglGetExtensionsStringARB!
getGLES2ExtensionString: Could not find GLES 2.x config!
Failed to obtain GLES 2.x extensions string!
Could not initialize emulated framebuffer
emulator: device fd:964
HAXM is working and emulator runs in fast virt mode
emulator: WARNING: Requested adb port (5769) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
[android] Emulator reported that the console is available on port 5 768
[android] Waiting for emulator to finish booting...
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe -s emulator-5768 wait-for-device shell getprop init.svc.bootanim
emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.
ERROR: Timeout after 45000 milliseconds
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe kill-server
Finished: NOT_BUILT
More details :
I have increased VMHeap, changed graphics to automatic, Hardware GLES 2.0 or Software GLES 2.0 (as in Android emulator: could not get wglGetExtensionsStringARB error or could not find wglGetExtensionsStringARB)
I have Tried many screen resolutions
I have added window.x = 0 window.y = 0 to #Nexus5X_6_8664.ini
Method 2:Creating a new emulator
Screenshot of the second method
In the job's configuration , Select "Run an Android emulator during build", then "Run emulator with properties" :
Android OS version : android-23
Screen density : hdpi
Screen resolutions : 480x800
Device locale : en_US
SD card size : 64M
Target ABI : x86_64
Emulator name suffix
When i run the job it gives me the following error :
Started by user Amine
Building in workspace D:\jenkins\workspace\Emulator
[android] Using Android SDK: D:\Tools\Dev\sdk\
[android] Creating Android AVD: C:\Users\Amine\.android\avd\hudson_en-US_240_WVGA_android-23_x86_64_mySuffix.avd
[android] D:\Tools\Dev\sdk\/tools/android.bat create avd -f -a -c 64M -s WVGA800 -n hudson_en-US_240_WVGA_android-23_x86_64_mySuffix -t android-23 --abi x86_64
[android] Could not create Android emulator: Failed to parse AVD config file
Finished: NOT_BUILT
When i run the same command above on my command line manually to investigate te errors it gives the following error :
Error: Flag '-s' is not valid for 'create avd'.
I try to remove -s and then -t then it requests :
Error: Package path (-k) not specified. Valid system image paths are:
system-images;android-23;default;armeabi-v7a
system-images;android-23;google_apis;x86
system-images;android-23;default;x86_64
system-images;android-23;google_apis;x86_64
system-images;android-23;default;x86
system-images;android-23;google_apis;armeabi-v7a
Method 3: Using command lines instead of Android Emulator Plugin
[Screenshot of the third method][3]
I have then decided to drop the Android emulator plugin and start using a regular Windows batch command from jenkins with the following lines :
D:
cd D:\Tools\Dev\sdk\tools\
D:\Tools\Dev\sdk\tools\emulator.exe #Nexus5X_6_8664
When i Run "adb devices" on separated command line I am able to view my emulator finally running; However the emulator's window is not displayed and it keeps displaying the following error :
D:\Tools\Dev\sdk\tools>D:\Tools\Dev\sdk\tools\emulator.exe #Nexus5X_6_8664
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
init: Could not find wglGetExtensionsStringARB!
OpenGL backend 'angle' without OpenGL ES 1.x library detected. Using GLESv2 only.
eglMakeCurrent failed
eglMakeCurrent failed
eglMakeCurrent failed
eglMakeCurrent failed
Please note if i run D:\Tools\Dev\sdk\tools\emulator.exe #Nexus5X_6_8664 from my command line manually I'm not having any problem as the errors above.
More details :
Jenkins services are running with my Login/Password access rights as an administrator. (I have followed cloudbees tutorial and it works fine)
I have added window.x = 0 window.y = 0 to #Nexus5X_6_8664.ini
On the issue with Method 1:
Can you try updating to the latest version of SDK tools. We had similar issue and it got fixed after latest updates.
Update the below and try again :
Android Emulator [27.2.9 (May 2018)]
Android SDK Platform Tools
Android SDK Tools
Intel x86 Emulator Accelerator (HAXM installer)
follow the below thread on how to update:
Emulator: ERROR :detected a hanging thread 'Qt event loop'

Cannot launch app to Microsoft Emulator

I've just installed VS2017 with Xamarin, including MS Emulator. When I create a new blank Android project I can see the drop down with about 6 emulators in it. The majority start with 'Visual Studio'. I assume they are the Microsoft Emulator? When I try to run I can see in the output it's going to the Google emulator and then it complains about turning Hyper-V off. I'm lost as to why it's not running the MS emulator. Any ideas?

Visual Studio Debugger failing to connect to remote Apache Cordova app in iOS simulator

I have been trying to debug an Apache Cordova app with Visual Studio 2015 RC in a Windows 8.1 Virtual Machine. The app is running in an iOS simulator in a MAC OS host using vs-mda-remote (I've tried with different iPhone versions), but the debug always times out. There doesn't seem to be a proper error, only the following:
Starting launch process C:\Program Files (x86)\nodejs\node.exe "C:\Users\User\AppData\Roaming\npm\node_modules\vs-tac\emulator.js" --platform ios --action launch --path
"C:\XXXXX\bld\ios\Debug\buildInfo.json" --serverUrl iMac-User.local:3000 --language pt-PT --cliVersion 5.1.1 --deployTarget "iPhone 5"
Timed out connecting debugger to remote Apache Cordova app. See Output window for JavaScript console output.
------ Cordova Tools 5.1.1 already installed.
emulated - Successfully sent to ios Simulator
Emulating app at /Users/user/remote-builds/builds/5689/cordovaApp for target iPhone 5
Asking to debug in remote iOS device for buildNumber 5689 in server iMac-User.local:3000...
Fail to debug remote iOS in order to compile C:\XXXXX\bld\ios\Debug\buildInfo.json to http://iMac-User.local:3000 :
iPhone 5
I have already tried to clean cordova's cache, using vs-mda-remote --secure false and some other suggestions I found online. However, nothing seems to work. It's not the project itself, as a friend of mine is able to debug it. The configuration from his computer seem to be the same as mine.
Any ideas on what might be the problem?
Thanks.
I have found the problem, there must have been something wrong with the installation of Homebrew. So I reinstalled it, and forced install ios-webkit-debug-proxy. This solved my problem and I am now able to debug the app.

Resources