Android - Emulator: I/O warning : failed to load external entity - android

I moved my Android Studio away from my C drive over to my F drive to save up on space but now I'm having trouble running my app to test it with Android Emulator.
event log image
Emulator: I/O warning : failed to load external entity "file:/C:/Users/Robin/.AndroidStudio3.1/config/options/updates.xml"
The location where this file is situated is actually in F:/Android/.AndroidStudio3.1/...
How do I tell the emulator to check at that location instead?
I've added an environment variable ANDROID_SDK_HOME with value F:\Android
I've set custom paths in idea.properties in AndroidStudio/bin
I've set the gradle path to F:/Android
Thanks in advance!

ATM, The only solution I know to fix this was to create a symbolic/hard link for the original file into the directory where android emulator looked it up. Well, that's how I fixed this issue. My guess was the search path for the emulator was hard coded into android emulator source. That's only my guess though.
So, in your case, just create a copy / symlink (recommended, as updates.xml often got modified by Android Studio on update) like this maybe (pardon me, as I'm not a windows user).
mklink C:/Users/Robin/.AndroidStudio3.1/config/options/updates.xml F:/Android/.AndroidStudio3.1/config/options/updates.xml
Well, I'll update my answer in case I get a better solution for this. BTW, I hope this can be any help for you :)

I found the right solution, in devices already created before the folder move, you have to change (in each) the path folder in the related .ini files, locate in the new .android/avd folder.
Example:
path=C:\Users\Name\.android\avd\EmulatorName.avd
to
path=D:\Android\.android\avd\EmulatorName.avd

Same issue was happening with me. Was facing the external entity error. Tried a lot to solve it even tried uninstalling and reinstalling but nothing works. Then i tried locating each and every file associated with android studio including android studio project and there were many more stuff, was easy to find as all were in user of my c drive. I deleted each and every file , all the projects and the changes i have made to my android studio were deleted. Then i restarted the app. Works fine for međź‘Ť

I had the same issue.
after clicked File ---> Sync with File System, it works

Related

Error message in Android Studio when trying to run and load emulator for the first time

The error message is:
PANIC: Could not open AVD config file: C:\Users\Darth\.android\avd\Nexus_5_API_21_x86.avd\config.ini
I've looked in that directory and there is no config.ini file. Only a userdata.img file.
When looking in the AVD manager the actions column says "Failed to load". If I right click it and click details it shows an error of:
Error: Failed to parse properties from C:\Users\Username\.android\avd\Nexus_5_API_21_x87.avd\config.ini
Fixes attempted that didn't work:
1 - Try choosing a different device definition. (config.ini file still missing when choosing multiple other devices)
2 - sharing the .android directory with my whole homegroup (selecting a device still doesn't generate a config.ini file, same error persists)
FIX: Thanks for all the replies. The fix that worked was changing the Memory of the AVD to 512!
I also had this same error, but the cause wasn't mis-matched x64 vs x86. Turns out my emulator failed to load because the skin wasn't defined. The way that I fixed it was:
Remove any previous wear emulators that failed
Pick the Model (Round/Square) and Android version(Lollipop, for instance)
On the final screen, click "Show Advanced Settings"
Scroll all the way to the bottom and set the "Custom skin definition" to "AndroidWearSquare" or "AndroidWearRound", which should be at the bottom of the skins list
Then after you're finished it should all just work!
Just put the Android SDK in the same Drive where you have installed the Android Studio 1.0. There is a problem if these drive letters are different. This will definitely work for you.I have solved this last week.
Try to use an AVD Manager from C:\User\<%USERNAME%>\AppData\Local\Android\Sdk\
https://code.google.com/p/android/issues/detail?id=78577#c25
For windows:
1) in the environment variables add a new "system variables"
ANDROID_SDK_HOME=D:\Program Files\android-sdk-windows (select your home directory of android sdk )
2) modify system variables Path, add "%Android_SDK_HOME%\tools;"
I have created many emulators and never touch .android\avd\Nexus_5_API_21_x87.avd\config.ini
you just create an Emulator, try to avoid "warp user Data", chose the appropriate Device and target API, set the SD memory to amount you want, and do the same with external RAM,and there is no reason to not work.
guesses: may the \Nexus_5_API_21_x87.avd\config.ini is read only! or you don't have permission to access .android/ (share this folder to all users,and give them full acsess.
I hope this will help
As I mentioned above I was facing the same issue.
For me it looks like the bug of the build and definitely not the issue rights, while another file was perfectly created (userdata.img) as well as the whole folder for the avd.
Solution #1: without changing anything in installation, I just found config.ini file in the internet. For example here is the config.ini for Nexus_S_API_21
So then I created Nexus_S AVD and put the config file in the folder. Then it starts working.
The issue with this method:
limited devices
config updates manually through config file
I still had some issues, e.g. instead of displaying the project I was displayed with the home page of Android, and there was no my app
Solution #2: Then I totally removed the Android Studio and cleaned all the stuff and downloaded 0.8.14 from scratch, during installation I updated it once to v.0.9.9. and then didn't update further.
In this version - everything worked just fine without any manipulation. AVD created from the first time and when launched - the project screen is displayed opened with Hello World.
I had the same issue and I was able to fix it with the below solution.
Root Cause: My system is 32-bit and the config.ini file was present in
C:\Users\Saajan Pruthi\.android\avd\Nexus_5_API_21_x86.avd
instead of
C:\Users\Saajan Pruthi\.android\avd\Nexus_5_API_21.avd
Note the x86... I simply copied the config file into the later folder and it worked.
I had the same issue inside Linux. The problem was that made install with root and executed the Android Studio from mi normal user, so in the momment that I install Android Studio every files android for emule stay here:
/root/.android/avd/Nexus_5_API_21_x86.avd
/root/.android/avd/Nexus_5_API_21_x86.ini
So you need do copy the files at your user, then:
sudo cp -Rf /root/.android /home/YOUR_USER
I hope that be help. Regards.
I did the following and it worked:
moved the sdk folder from C:\Users\User\AppData\Local\Android\sdk to the Android Studio program folder under C:\Program Files\Android\Android Studio\sdk
Restarted Android studio and reconfigured it to point to the new sdk folder
Recreated the emulator and started it
I had this problem as well. I just removed the AVD and added it back again - emulator is running fine now.
I had the same problem, and it turned out that my hard drive was full. For anyone still looking for a solution, definitely make sure you still have space.

Android Studio 0.5.8 and Gradle to work offline after gradle zip is downloaded

I've installed a fresh version of Android Studio and from there created a new application. It created my file but the Gradle causes me a lot of problem. For the whole day straight it always try to download the gradle-1.10-all.zip but as always it fails.
Message is:
Gradle:Download http://services.gradle/org/distributions/gradle-1.10-all.zip
Hope they decide to add up some progress bar for this. LOL
I'm in doubt that this is due to internet connection just to take note. Although I'm investigating about the possible solution via HTTP proxy.
Now for an alternate solution I tried to download the whole zip file instead from http://www.gradle.org/downloads. While I successfully downloaded and extracted the whole zip file. Then from android Studio I tried setting the Global Gradle Settings into offline work and as well as the Project-level settings into: use local gradle distribution and mapped the extracted zip file (although I'm not sure if this is the correct way to do this)
Does anyone know on how should I do the workarounds for this?
Hope that maybe someone can help me work with this or someone who already solved this issue since for now I don't have a plan to update from this version anymore given that each and everytime that the Android Studio updates it was always been a pain in the ass and Second I need to work on most of my projects offline.
Found out the solution on this. First you need to download the whole zip file from: http://www.gradle.org/downloads
Next step is to just let the Android Studio Create the folder for the .gradle in your User then from there you can just halt the project initialization and then go to the location of the .gradle folder. In my case it's:
C:\Users\USER\.gradle\wrapper\dists\gradle-1.10-all\SOME_SORT_OF_STRING
Just copy and paste the whole zip file on the location (no need to unzip the file). Also you have to make sure it has the same version with the one in your gradle wrapper folder which in my case is gradle-1.10-all.
Try restarting the Android Studio. You can create a new project once again and let it extract the zip file. It should now start on downloading the other files needed and from here you will need a reliable and stable internet connection. The succeeding files will have a smaller size compared to the zip package but in my case since I don't have a stable connection I used to tether my mobile phone instead and viola! Android Studio installation is now complete and running.
There exist options for offline working.
On command line add --offline option to your gradle command.
In Android studio you can set this option in the setting on the gradle configuration part. Just check the checkbox
Another way of doing is to find a friend that is already started using the studio, You can copy .gradle ,. androidstudio/.androidstudiobeta and .android directories in your user directory. If gradel is your only problem just copy that one only.

com.android.ddmlib.SyncException: Local path doesn't exist - While compiling app with eclipse

I get the following error sometimes during compling and running the application using eclipse.
Failed to install ABC.apk on device '4df11bd574734fd9': Local path
doesn't exist. [2013-08-20 09:28:04 - ABC]
com.android.ddmlib.SyncException: Local path doesn't exist.
[2013-08-20 09:28:04 - ABC] Launch canceled!
The pop up in eclipse says that, the application contains some errors, which I need to fix.
I have updated my eclipse and other related things to latest.
I followed all the posts whihc talks about resolving this error, but none of them work for me. I see that once I get this error, my bin folder is kind of locked and I cannot delete it. Currently, the only option left for me is to restart my laptop and then it starts to work again but it is very tedious and time taking.
Can someone suggest me what should I do?
Well finally I make it. there was a program/process that has blockep miapp.apk file, so when I tryed to clean my App it doesn't drop this file. I stop the program/process and delete manually apk file. now its running great.
okay i found the solution
just transfer all your project directories except bin directory into another folder location of same name as your project name.Now import your project from new location.your project will run this time
Also suffered from this issue. The culprit turned out to be Google Drive, which for some reason locked the .apk file after I shared it to my Drive and then caused all kinds of headaches.
Closing the Google Drive tab fixed the issue.

Eclipse - Android not auto-generating R class

have an odd one..
Using Eclipse Juno, and everything was working fine for the last couple months. At some point yesterday, while Eclipse was cleaning my project, something crashed - popped up the Windows error reporting. (Didn't catch the name of what crashed..)
Now, I have no R.java class in /gen, and nothing I've tried will generate it. On top of that, when doing a clean rebuild of the project, the Output window remains blank. (No errors, no status message.. nothing.)
Tried just about everything - including the latest which included reinstalling Eclipse and then ADT. Still hadn't helped. (I have NOT tried clearing the workspace metadata yet, will do that soon.)
Any thoughts on what else to check?
--Fox.
Edit: Updating a random file - either .java or an XML layout/drawable does not have any effect, still nothing. Also, removing saved preferences from workspace .metdata data didn't have an effect either.
Edit 2: Okay - not sure WHY it was happening, but creating a new project and the issue was corrected.
So somehow either the project settings (.settings or project.settings) must have gotten corrupted. I have the origianl project still, and am curious to see why it happened, but creating a new project and copying sources and resources over, and no more issue.
Thanks to all that offered comments - goes to show that any kind of little corruption can cause strange things to happen.
The reason in 99% of the cases is that you are missspelling something in some xml file.
The R class file won't appear until all xml files are correct.
I suggest look carefully into your XMLs for a very small syntax error.
Or try taking off 1 by 1, until you figure it out wich one is the problematic.
:) kind of annoying, i know.
If you don't have any errors in your xml files, you tried to reboot your eclipse, your emulator, then open the sdk manager and apply all update. My R have finally been generated.
I found this happened after updating my Android SDK Manager and related eclipse plugins. I am running in Ubuntu, and it would not let me update the plugins unless I ran as the root user (using "sudo eclipse")
This left some of the Android SDK Manager items, and the eclipse plugins, owned by root. This stopped the "clean" working on the project - it must have been something that had been added as the root user, and not accessible as my normal user.
I had to "chown" my eclipse directory and my Android SDK Manager directory so it was owned again by my normal user:
cd /home/myacct/android-sdk/
chown -R myacct:myacct *
After this the clean option worked, and R was regenerated.
This was it for me:
In your AndroidManifest.xml file, make sure that you have the SDK installed for the version number in android:minSdkVersion="##".
You can install SDKs from the Android SDK Manager, found under Window -> Android SDK Manager in Eclipse / ADT.
For me it ended up being gen/com/(appname)/R.java missing.
Not in my recycle bin, not anywhere... just took a surprise vacation and never returned.
I had a backup copy in a different folder. Copied it back and all's good now

invalid APK file

Hi i am new to android dev.
getting error ..
[2011-01-17 11:15:48 - TriviaGK] Installation failed due to invalid APK file!
[2011-01-17 11:15:48 - TriviaGK] Please check logcat output for more details.
[2011-01-17 11:15:48 - TriviaGK] Launch canceled!
plz tell where is logcat stored and how to debug this.
Also another app is running successfully in same enviroment.
Please Help android geeks.
I know this question was asked in January, but, did you try cleaning the build? I just got this issue and solved it by going to Project --> Clean... and then running that. It'll delete your APK's and then when you run they'll be rebuilt. Worked for me!
In Eclipse, go to Window->Open Perspective->Other and you should see DDMS as an option. If you choose this perspective LogCat is shown by default along with some other debug tools. If it does not show up, you can find it under Window->Show View->Other->Android->LogCat.
Check the default.properties file to see if the target-sdk (which version of android you want the app to be targeted to) and be sure that you actually got the sdk for that version of Android.
If you don't, either download the right SDK or change the target sdk in default properties.
For me the problem appeared to be that I made archive of the "www" folder - tar.gz one, for backup - on the same place where the "www" folder itself is - inside the "assets" folder. And that archive was causing the error.
All other projects were launching fine. And when I deleted this archive - the error was gone.
PS: when I made .zip archive of the "www" folder - and the project could run fine with no problems :D ... haha :D ...
Small chance that you have the same problem, but still:
After viewing the Logcat output I noticed that your Android project should not contain (or at least not start with) an underscore (_).
edit: As I see now, the console log you posted has your project name in it, and does not contain any underscores. So this answer won't solve your problem, but might still be usefull to others.
Zip aligning a file can also cause this issue. If you are having it, try uploading the signed APK file (prior to zipalign) to your device and see if the problem persists. If the problem hets fixed, then ZIPALIGNING it is not working properly.

Categories

Resources