I'm new to Android/Kotlin programming (not to programming in general) and I'm following the Kotlin Basics course on developer.android.com.
The very first lesson after having installed Android Studio is to create a Virtual Device and run an extremely basic app on it.
However I can't get the emulator to work. The very first time I tried, it opened a small window with a progress bar but it became unresponsive at around 1/4 progress and I had to eventually kill it.
Since then it just won't start/open.
After I click run, the code compiles and the Event Log within Android Studio says Executing tasks[...] then Gradle build finished[...] and that's it. Nothing happens beyond that and the Emulator window says "No emulators are currently running".
However:
Some emulator-related processes have been started. Those processes stay alive even after closing Android Studio..
If I try to start the AVD from within the device manager, I get an error message that the device is already running
I am unable to delete these .lock files without killing the aforementioned processes
What I could find:
The Windows Event Viewer shows an Application Error
The Android Studio log file also shows an Error
I don't know what to do with either of these messages, though
What I tried
Killing the emulator processes, removing the *.lock files and trying again.
Creating a different AVD (different device, different version of Android)
Completely reinstalling Android Studio and the SDK following the accepted answer to this question: How to completely uninstall Android Studio from windows(v10)?.
None of this had any effect.
I'm running Android Studio Arctic Fox (2020.3.1 Patch 4) on Windows 10 Pro (10.0.19042 Build 19042).
I am able to run the app on my actual phone but down the line I would like to be able to test apps on different types of devices or without having to always use my physical one.
All help would be greatly appreciated.
By running and emulator.exe command in a command prompt, I was able to see yet another error message, the same one as in this post: emulator: incompatible HAX module version 3 requirs minimum version 4, and the answer to that post from user Harold Sota (as well as the comment under it from Harun, more specific to my situation) solved the issue.
Related
I'm now stuck assuming its hardware, but wouldn't make too much sense as it used to work before, and just stopped out of nowhere.
Yesterday the whole day, when trying to open emulator on any device, in any api, in any app (including opening just the emulator by itself), I get This crash message.
I've tried uninstalling and installing android studio, and didn't work. I ended up fully formatting my pc, and installing AS again. The error persisted in the first 3 runs, and after creating a device running api 28, it shows This error (that I have had before). When I used to see it, I would still be able to run the app, but now it was just a black screen.
I found out that even though I installed the latest recommended version of AS, it didn't come with abd.exe. I downloaded the plstform-tools.zip, and when adding everything inside my sdk folder, avd stopped working. I decided to only add instead, the abd.exe file. Avd opened again, but the screen still stayed black.
I'm running amd Radeon 7500, so I decided to try an emulator running ARM64. The emulator just loads forever, but never opens up.
Right now, when I try to run api 29 or 30, instead of getting the same crash message as usual, I will just get a pop up saying the emulator was terminated, and shows in console log "error while waiting for the device: emulator proccess for avd was killed"
To add: for some random reason, all my installations today and yesterday, did not include an uninstall.exe
I tried opening emulator using CMD, and the error I get is
"cannot add library vulkan-1.dll: failed
cannot add library vulkan-1.dll: failed"
I have seen this error online, but seems like it usually shows an extra line saying "Emulator terminated with exit code" Mine does not have that.
I also have tried using Emulated performance in Software mode
Someone at Reddit was able to help me:
for anyone that gets stuck here in the future, try this:
open c:\Users(user name).Android and create a file called “advancedFeatures.ini”. In this file, write:
Vulkan = off
GLDirectMem = on
When trying to run my device emulator on Android Studio, a pop-up appears:
Previously, I had gotten the error 'Unable to locate adb', but after replacing the default platform_tools folder with the
official version, this pop-up now replaced the last one. I don't think this is a problem with my installation, as I've uninstalled and reinstalled Android Studio and the flutter-sdk several times, each attempt met with the unable to locate adb error, then this one. Could it be the way I'm unzipping a certain file? I'm grasping at straws here.
Are there any fixes for this? To be honest, I'm not even sure where to start. I haven't seen any other page that describes getting this error while trying to launch an emulator.
Thank you for your time!
Edit: Error description in plain-text:
EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue#2c5cc720
Current thread: Thread[ApplicationImpl pooled thread 4,4,Idea Thread Group] 1175604479
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 1657237134
I've tried to create a new device and wipe the data on my current one, but that just results in the unable to locate adb pop-up again (I don't have an antivirus like Avaast enabled by the way), and I am absolutely certain that adb.exe is in my file-path (C:\Users\User\AppData\Local\Android\Sdk\platform-tools\adb.exe). I have uninstalled and reinstalled platform-tools from the SDK-manager multiple times, each instance being met with this same error. I cannot run any flutter program, on any emulator. I have not yet tried with a regular Android Studio project. Any ideas?
so, i'm still not sure why the EventQueue error is showing, but what I do know is that the unable to locate adb is a negligible pop-up if you know for certain that adb.exe is in your file-directory. My issue was that I didn't have enough memory to run the emulator on my machine, so be sure to have plenty of room while developing apps (~11 gigs while using Android Studio and flutter-sdk)! That's all, it certainly was a strange experience working through it.
In my case, what helped, was to just restart an emulator.
I wish to run an application on android virtual device (I've created it). I right-click on the
Android project (which was created after I added the android environment) and choose "Run as Android Application". The emulator launches but it remains just a black window (and I wait a lot, nothing happens). Console writes "Build successful" and that's it. What might be the problem? API level is 18 (4.3). Platform Windows 7. Thanks.
Details: created a project, added hybrid application, added adaptors, deployed and run multiple times (just in browser), installed android in eclipse, added android environment, added AVD (had some old ones that didn't work, deleted them and created a new one following advises here).
It sounds like the problem is with your Android emulator.
First, can you start the emulator by itself, and see it work properly? You can start it from AVD itself. The emulator usually takes a long time to start, especially if you are running the ARM emulator instead of the x86 one.
If that works, can you run an empty Android app? You can go to File - New Project - Android Application Project, and after you create it, you should be able to run it and see an empty application.
If that works, can you try with an empty Worklight application? That way we can see if it is your specific application or something to do with Worklight.
I am new to Android development and Eclipse. I have been given an Android app and asked to make some simple changes to it. I can build the project and run it in the emulator, but I see some errors in the LogCat window in Eclipse.
I put aside the app I was given and wrote the Hello World app, following the Hello World tutorial on developer.android.com. With this simple app, I was surprised to see many errors and stack dumps in the LogCat window. I closed Eclipse and re-launched it. After waiting for Eclipse to finish initializing, LogCat was empty. Then I started the Hello World app by clicking the run button. After a while entries appeared in LogCat, including many errors.
With such a simple app, copied from the tutorial, I am guessing the errors arise from the development environment and/or virtual device rather than from the app itself, but I would like to be able to run apps without errors.
Is it a reasonable expectation to be able to run Android apps from Eclipse on an AVD without any errors? Or is it the state of the art that the development environment logs many errors and dumps stack traces even when everything is running "normally"?
If it is reasonable, I will pursue each error until I have cleaned up my environment and application. I would prefer this, as I would then know that if errors appear as I continue development, they arise from my application and must be fixed. On the other hand, I can't spend months developing Eclipse and the Android SDK. If I have to learn to live with logs full of error messages, I'll just ignore them unless something crashes.
Note that the Hello World application runs as expected - it appears to be working despite the errors.
I am running Eclipse Indigo SR2 and Android SDK ??? (I don't see a version number for the SDK - the installer is r18 and SDK Manager says there are no updates available) on Windows 7 Professional, 64bit. I am testing with Android 4.0.3.
Use either:
adb com.your.package:v
or in log cat on the side button (You may need to make this visible by pressing the button with two rectangles in it in log cat) press the plus button and then add an application filter
Many times I cannot get my application to install on the emulator.
I receive the following error from Eclipse:
[2010-08-06 09:33:48 - Emulator]
2010-08-06 09:33:48.868
emulator[392:903] Can't open input
server
/Library/InputManagers/MultiClutchInputManager.bundle
The emulator boots, but the application is not installed.
MultiClutch is a 3rd party preference pane for OS X that allows you to capture gestures and specify what they should do. I've uninstalled MultiClutch (using AppCleaner), yet I still receive this error. I'm not quite sure what makes Eclipse decide to ignore it, but after attempting to run enough times, a NEW (read: second) emulator window will open and the application will install.
Any ideas?
This is because of the library component of the Android is not proper.
solution : what you can do is update the Android SDK. and create new AVD and install latest ADT plugin it will be resolved