"Emulator: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [C:\Android\sdk]!" in Android Studio - android-studio

I could use the emulator properly two days ago and now it does not work.
I understand there are many people facing this problem. I have read many of them and tried the solutions stated there (set/change the environment variable of ANDROID_SDK_ROOT & ANDROID_HOME, re-install Android Studio, check avd file, etc.), but did not solve the problem.
My sdk file is in C:\Android\sdk and that is the place where Android SDK Manager in Android Studio found Android SDK as is existing. I have set ANDROID_SDK_ROOT value to C:\Android\sdk. I do not know what else to do. Is there anyone who knows how to resolve this?
I am using Android Studio 3.5.3 on Windows 10.
Thank you in advance for your reply.

I got the same problem recently and got it solved after doing some googling and trying..
It's because the emulator can't read path that containing non-ascii strings properly and in default AVD-specific files are located at C:/Users/%USERNAME%/.android/avd/, but somehow the error log doesn't give right hint and mislead us to focus on ANDROID_SDK_ROOT, so you only need to add ANDROID_AVD_HOME variable with a ascii path like ANDROID_AVD_HOME=D:\Android_avd and restart your IDE. After that your emulator will run properly.
More info https://developer.android.com/studio/command-line/variables
Update: You may need to create a subdirectory .android like C:\test\.android and add a ANDROID_SDK_HOME=C:\test variable, then add a empty .emulator_console_auth_token file which locates at the corresponding floder according to the error log, for me it's C:\Users\鍑濈传绉嬭悓\.emulator_console_auth_token.
After that you should run it without any error, I've already tested it.

https://github.com/flutter/flutter/issues/24988
https://www.reddit.com/r/AndroidQuestions/comments/6of9kp/error_when_starting_emulator_panic_broken_avd/dkgzing/
https://inneka.com/programming/android/panic-broken-avd-system-path-check-your-android_sdk_root-value/
You might not need to setup path. Try to run without path.

Related

Location menu in extended controls of Android Studio virtual device

I need to import a .gpx file to my virtual device (something I'm attempting for the first time today), but I'm having a problem I can't find any reference to anywhere else. I'm either having a moment and missing something that should be obvious or there's an issue with the specific build I have that's causing an issue. I have Android Studio 3.5.3 installed and I've tried multiple different virtual devices.
All references to the menu page referenced in my title that I can find online look like this:
While my version of that page looks like this:
That "Import GPX/KML" button always appears to be greyed out. What am I missing here?
Eventually found the cause of this and a solution. The issue was caused by an Android emulator release that updated the Location settings to include a Google Maps based UI. Release notes here, though I've found the 29.2.11 release on 03/12 also contained the UI change: https://androidstudio.googleblog.com/2019/12/emulator-29212-stable-google-maps-ui.html. On my Windows 10 computers this also removed the option of importing a GPX file (not sure if this was an intentional choice by Google or a bug). Not sure if it will affect Linux or Mac users but I've observed the issue on multiple Windows 10 devices.
The fix I found for the issue was to downgrade my emulator to 29.2.1. That version can be found here:
http://dl.google.com/android/repository/emulator-darwin-5889189.zip
http://dl.google.com/android/repository/emulator-windows-5889189.zip
http://dl.google.com/android/repository/emulator-linux-5889189.zip
In Windows, next go to C:\Users[username]\AppData\Local\Android\Sdk\emulator. Those of a cautious disposition can backup this folder, but either way the package.xml file will be needed and everything else can be moved or deleted. Edit the details in the XML to match the version number of the downloaded emulator. Copy the downloaded files to this location along with the package.xml. Then just make sure not to download the update again when Android Studio is opened.

Android Studio - No SDK Found - Setup wizard fails - Firewall Proxy

So getting right to the point, I am behind a corporate firewall. I had to manually download the zip file for Android Studio which I extracted to program files (windows 10) on my machine. When I launch studio I'm dialogue'd studio needs to retrieve sdk's which I try to do but it fails on these 3 zips.
build-tools_r29.0.1-windows.zip
platform-29_r01.zip
sdk-tools-windows-4333796.zip
Mostly I see
java.net.SocketTimeoutException: Read timed out Warning: An error
occurred while preparing SDK package Android SDK Build-Tools 29.0.1:
Read timed out.
I'm assuming my firewall proxy is preventing this type of setup install since the links to these zips point outside our network but I am able to download the zips individually through a browser session one by one and save them here
c:\Users\myPin\AppData\Android\Sdk
I extracted each zip file and then reran Android Studio but it doesn't seem to have made any difference. It still goes out trying to download the same packages which I already extracted to the SDK folder. Shouldnt studio see the zips I've extracted in the SDK folder location? How can I get this working?
So we have work around I think others might find useful. If your having problems with the Gui SDK manager, then definitely use the cmd based sdk manager. This did not time out for us.
So for example where in the Gui I would get something like
java.net.SocketTimeoutException: Read timed out
When tryin got get platform-29_r01.zip
But if I try to perform the same operation using C:\Users\PIN\AppData\Local\Android\Sdk\Tools\bin\sdkmanager.bat using whatever cmd tool you like (I like cmder).
.\sdkmanager.bat --proxy=http --proxy_host=access.lb.ssa.gov --proxy_port=80 "platforms;android-28" --verbose
The above cmd will dl's and configure the sdk correctly.
You may have to do this for any of the sdk's you require. I think in our Firewall proxy scenario there's a user-agent setting or something that is not set for the Gui which is causing the timeouts but not with the cmd tools so this is a legitimate work around I think.
First things first. You have to check your Computer time, it must be accurate. If still error appeared, try this.
On you PC search Powershell and type code below. See image below for reference.
Path reference
Powershell Image
Failed version code
Click Retry
.\sdkmanager.bat --proxy=http --proxy_host=access.lb.ssa.gov --proxy_port=80 "platforms;android-29" --verbose
Run powershell > type cd> path of files
Check what SDK number version is getting error
From the android studio ERROR, click Retry while powershell is running.
If the said SDK version number is fixed, go to the next version number, by pressing control+C to powershell to stop the command.
Then type the same code with different number..
Note: If you do not have bin folder. You can create a folder named bin and create sdkmanager.bat file, inside sdkmanager.bat file, type this code >> sdkmanager.bat and save.

Vuzix sdk loading error cvc-elt.1.a cannot find the declaration of element 'sdk: sdk-addon'

I am trying to load the SDK for Vuzix through the SDK manager in Android Studio but for some reason it will not display the downloads in 'SDK platforms' and 'SDK tools'.
In the 'SDK update sites' tab next to the Vuzix link I added there is a red exclamation point that displays " cvc-elt.1.a cannot find the declaration of element 'sdk: sdk-addon' " when hovered over.
I am new to SDK's and have no idea what to do for this error. I've downloaded the android SDK's and sources for 26,25,24, and 23 thinking it could help but the error still shows up.
I still don't know what the error means but I solved it by connecting to my hotspot instead of my work network.
So my guess is it was a firewall issue or something, if anyone else has this error.
This means that the parser does not know the namespace. I tried it on Win7 and android studio 2.3.3 with the same result.
I tried it without the namespace or running android studio with oracle sdk. Both failed.
At the moment I try to run it on a virtual linux machine. Android Studio 2.3.3 will parse the addon xml file and download the files.
On Win7 I installed them manually, but they were not really integrated into to system and I stucked when I wanted to use the barcode SDK. maybe I am able some day to add simply this jar lib -
On a first look using linux seems to be the solution. But than I run into problems with the case sensitve file system. The vuzix SDK seems to need a linux system on a case insensitve file system.
*facepalm* and I am quite sure that i will fail at all. On linux a simple GUI compiles only against API 26 without errors.

Android Studio Project Can't Use AVD

I'm starting to use Android Studio for the first time, and I've run into a snag. When I followed an example and made a helloworld app, no problem. However, I tried to make my own app, which was literally just a Blank Activity, and it can't use Android Tools, or the AVD. I then deleted this project from both AS and in Windows Explorer, and remade it, multiple times. It never fixed the problem. This app was called D&D 5e Character Roller.
I then made another app called DnD 5e Character Roller, which did not have the same problem - it can use AVD and Android Tools.
At this point, I believe that it may simply be due to the ampersand in the name of the first app, but this seems like a weird reason for it to fail - it at least should have told me that would be a problem when I was trying to make the app. Is this a known problem with AS? My searching turned up nothing related to it. If not, what is the problem? If you are at home, can you try to make a similarly named project(with an ampersand) and see if you can use AVD/Android Tools, which would make it a problem with my install of AS.
Thank you.
you should have opened the module setting of your project, there sdk path or gradle version should be missing.

Visual Studio 2012 failed to create project

I just upgraded to windows 8 from windows 7. Visual studio 2010 broke down completely. Oh well. I removed vs2012 and installed visual studio 2012, where the pain starts. I have been reinstalling vs 2012 a couple of times. However, the symptom remains the same.
When I try to create a new project (FILE -> New -> Project or ctrl + N).
It pops up with an error message dialogbox saying
"Failed to create a ImageSource from the text '..\Images\Medium.png'.
" I am like ##*%&^#*###(. So can anyone please tell me what is going on with my Visual Studio2012?
By the way, I can open and run the existing vs2010 projects with no problems.
I definitely neither want to do a fresh install on windows 8 nor rolling back to my windows 7.
Cheers,
To resolve that problem, I've change the permission of "modify" for "everybody" on the files
c:\windows\microsoft.net\framework\v2.0.50727\config\machine.config
and
c:\windows\microsoft.net\framework\v4.0.30319\config\machine.config
Don't know if it's the best way to do it, but at least it works.
Do you have any codec packs installed on your system? I had a WIC codec pack for viewing RAW files in Explorer, and it resulted in the same issue you are describing. Uninstalling the codecs fixed Visual Studio for me.
I was having various issues, including the above.
To resolve the problem on Windows 8 for VS 2012, setting it to run as administrator fixed the problem for me.
Launch icon properties->Advanced Properties->Run as administrator
I hope this helps.
Cheers,
Sean
The trace of this issue leads to Windows Imaging Component (one solution proposed was to remove FastPictureViewer, which codec affects WIC, but it was not my case). I used procmon to log all file and registry calls and found that VS2012 stumbles at the following key:
HKLM\SOFTWARE\Classes\.png - REG_SZ Content Type
I was suprized to see that Content Type for .png was set application (for .jpg it was application as well). After correcting it to image/png, not only VS2012 started successfully, but VS2010 as well, that was showing "Provide value on System.Windows.Baml2006.TypeConverterMarkupExtension threw an exception" on Win8 and caused me to try VS2012.
I had the same problem with Visual Studio 13.
uninstalling/reinstalling VS13 and all shared packages did not solved the problem.
Finally I tried to run it as administrator, as explained above and it worked.
Just happened to me. As Eric Aubry said check the machine.config file. In my case it wasn't permission error but the fact that the file was destroyed internally. By renaming the machine.config.default everything was fixed.
For me, this happened when I installed mysql on my machine, and it added an extra connection string to my machine config. However, since I was using a separate file for configSource, it resulted my machine config to become corrupted.
Moving the new config key to my config source from the 32bit machine config solved the issue.
As I mentioned in that question ,
I tried almost every solution I found.
I would like to share, what I have tried and did not work and what did work and solved the problem.
Here are the "solutions" which did not work for me but claimed that they worked for some people.
1) Removing FastPictureViewer Codec Pack (which was already not installed)
2) Having a modify permission to everyone for
c:\windows\microsoft.net\framework\v2.0.50727\config\machine.config
and
c:\windows\microsoft.net\framework\v4.0.30319\config\machine.config
3) Using Procmon to see broken registries
4) Uninstalling/reinstalling VS13 and all shared packages
5) Renaming the machine.config.default to machine.config
6) Running Visual Studio as an administrator
And this what it solved it:
Simply installed all the updates for windows 8.1 (not only the important ones, also optional updates as well) and restart. It sounds crazy after spending hours and hours but that solved my problem.
Good luck!

Resources