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.
Related
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
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.
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.
Every time I open Eclipse, I get the following error messages:
Android SDK Content Loader:
parseSdkContent failed java.lang.NullPointerException
Initializing Java Tooling
An internal error occured during: "Initializing Java Tooling". java.lang.NullPointerException
Loading data for Android 2.2
Parsing Data for android-8 failed java.lang.NullPointerException
Loading data for Android 2.3.3
Parsing Data for android-10 failed java.lang.NullPointerException
Loading data for Google APIs (Google Inc.)
Parsing Data for Google Inc.: Google APIs:8 failed java.lang.NullPointerException
See link for screenshot:
http://i.stack.imgur.com/lhhQQ.png
(I am using OS X Lion, and Eclipse Helios)
First i read some posts saying that it was the AVD.ini file in the .android profile that was causing the trouble. I tried deleting all the entire .android profile folder as suggested in Android SDK Content Loader failing with NullPointerException. This didn't correct my problem.
I tried deleting the entire Android SDK folder, downloaded it again and installed a couple of Android versions through it. Still the same error messages...
To ensure that I didn't have any old plugins or something that were the issue, I uninstalled eclipse, downloaded it again and installed the Android plugin again. (So the plugin is up to date).
When I go into one of my Android projects, I get error messages on places where I acces resources by using the R file. Regular Java projects work fine, but all Android projects gets small red boxes with white crosses on them. I have been searching for a solution to this problem since yesterday, but at this point I'm completely qlueless and would appreciate any help I can get!
Close all open projects and exit Eclipse. Now you can open Eclipse without getting the error. Start opening your projects one by one to find which one causes the problem. This is most likely because you deleted a Device profile inside the AVD manager.
Do not delete all the full .metadata
Backup .metadata
delete only .metadata/.plugins/org.eclipse.core.resources/.project
restart eclipse
Observation : the projects folders are created
Further - if you are using svn/git/hg have code repository links it would be destroyed, so to reinstate
close eclipse
copy relevant projects from backup to merge with current projects in .metadata/.plugins/org.eclipse.core.resources/.project
restart eclipse
Downfall - sporadic fail error may occur (sync or something) - harmless
backagain
I encountered exactly the same issue this morning. This is a workspace related issue.
Solution 1
I looked into my .metadata and read .bak_number.log files . Some layouts failed to parse and my projects were out of sync with the file system.
So I deleted all the .bak_number.log files. Relaunch Eclipse and the whole worskspace should work again the way you left previously.
Solution 2
However if it's not due to out of sync with the file system. Change the workspace then import all the eclipse projects from the previous workspace.
Thanks the project.properties files , the dependencies are still kept.
PS : I should return to IntelliJ :)
first close your Eclipse
Go to your workspace and rename .metadata to tushmetadata and go to
tushmetadata- >.plugins -> org.eclipse.core.runtime -> .settings
and copy all files from it.
now open the Eclipse and go to your workspace there you can see the
newly generated .metadata folder in that go to .plugins ->
org.eclipse.core.runtime -> .settings and paste here and do not
overwrite any file.
Try to "Hello World" project and run it.
Try to delete file .metadata from your android workspace folder. .Metadata folder contains all configuration files for eclipse. It works for me.
Your answers might be right. What I did was to change my workspace. I redownloaded the project I was going to work on from git, and reimported it. Now it works fine :) Maybe there was some files in this project that made the error messages apear? Dunno....
I have remove the .metadata folder but after it, when I run the eclipse, I cannot creates any Android project. To solve it, I have done the follow:
Go to the main work directory of eclipse
Localize the folder com.android.ide.eclipse.adt It should be in .oldMetadata/.plugins/
Copy it to the new eclipse configuration: .metadata/plugins/
See the full solution here:
http://www.jiahaoliuliu.com/2011/06/running-android-sdk-in-eclipse-errors.html#solution4
For me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. It's not an Android project, but for some reason the newer versions of the SDK somehow expects the file there. To fix the problem, I just copied a project.properties file from an Android project to the host unit test project.
When I met this problem about a year ago, I had some projects in my workspace that needed a specific Android SDK level (let's say 2.1) and i didn't have it installed in the Android SDK.
slott's answer helped a lot. Deleting the .metadata or reinstalling eclipse didn't though. The trick was to isolate the project causing the problem, delete its .settings folder and .project file and reimport it.
I discovered another cause, where I'd added a space character into an otherwise blank line in the project.properties file. When I eventually ran android update project -p .
the program (android.exe) threw a NPE exception. When I deleted the space from the blank line the android update project command worked and eclipse started behaving (after running clean a few times).
This happened with r20 of the Android SDK on a Windows 7 64-bit machine.
FYI my change that fixed the problem in project.properties is public at http://code.google.com/p/android-daisy-epub-reader/source/detail?r=517
This is just weired.
In my case when I took a subversion update, I was getting this problem. The reason was the corruption of my project.properties file (due to subversion conflict).
I just corrected the file and problem got solved.
I found it's just missing project.properties file in the project folder. After copying one from another project the error is gone. The only valid line in project.properties is
target=android-8
If you are using SVN or GIT please check whether the project.properties has conflicts or not.
Sometimes project can not be open because of this.
I hope this is useful to someone and saves his/her time: My colleague was facing same issue and we did almost everything mentioned here, with no luck. In the end we changed the Android SDK version in the manifest file and it worked.
This solution worked for me.
Close Eclipse and delete all .markers inside your workspace folder.
Restart Eclipse (once I had to restart it twice, it hang on the first but worked on the second for no aparent reason).
Of course, it's always safe to back them up first.
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