ErGo_404
ErGo_404

Reputation: 1821

Invalid APK file when installing on my phone

I have been working on a project for 3 months now, and everything was working.

Since yesterday however, Eclipse won't let me install my application on my phone. The application compiles fine, but when I try to run the program I get this error :

Installation failed due to invalid APK file!
Please check logcat output for more details.
Launch canceled!

I have been looking for that error in Google and most people said it was a version problem. I set the uses-sdk version to 10, which is the platform on which I develop (and it has always worked before !).

When I check the logcat, I get this :

02-07 10:15:20.742: W/PackageParser(15356): Unable to read AndroidManifest.xml of /data/local/tmp/App.apk
02-07 10:15:20.742: W/PackageParser(15356): java.io.FileNotFoundException: AndroidManifest.xml
02-07 10:15:20.742: W/PackageParser(15356):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)
02-07 10:15:20.742: W/PackageParser(15356):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:486)
02-07 10:15:20.742: W/PackageParser(15356):     at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:454)
02-07 10:15:20.742: W/PackageParser(15356):     at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:601)
02-07 10:15:20.742: W/PackageParser(15356):     at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:138)
02-07 10:15:20.742: W/PackageParser(15356):     at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:100)
02-07 10:15:20.742: W/PackageParser(15356):     at android.os.Binder.execTransact(Binder.java:320)
02-07 10:15:20.742: W/PackageParser(15356):     at dalvik.system.NativeStart.run(Native Method)
02-07 10:15:20.781: W/DefContainer(15356): Failed to parse package
02-07 10:15:20.789: W/PackageParser(15356): Unable to read AndroidManifest.xml of /data/local/tmp/App.apk
02-07 10:15:20.789: W/PackageParser(15356): java.io.FileNotFoundException: AndroidManifest.xml
02-07 10:15:20.789: W/PackageParser(15356):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)
02-07 10:15:20.789: W/PackageParser(15356):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:486)
02-07 10:15:20.789: W/PackageParser(15356):     at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:454)
02-07 10:15:20.789: W/PackageParser(15356):     at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:601) 
02-07 10:15:20.789: W/PackageParser(15356):     at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:138)
02-07 10:15:20.789: W/PackageParser(15356):     at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:100)
02-07 10:15:20.789: W/PackageParser(15356):     at android.os.Binder.execTransact(Binder.java:320)
02-07 10:15:20.789: W/PackageParser(15356):     at dalvik.system.NativeStart.run(Native Method)
02-07 10:15:20.828: W/DefContainer(15356): Failed to parse package

I got the apk file from the bin folder, and when unziped it I found my AndroidManifest.xml inside it. I then checked the error status in Eclipse, and it says that Eclipse "Can't find file D:\xxx\xxx\xxx\AndroidManifest.xml in workspace". I also get the same error with a few xml layouts of the same project. However I can see, open, edit and save those files in Eclipse, so I find it a bit odd that it could not find them.

Last thing, yesterday I could install my app again after doing a clean project AND restarting Eclipse, but it does not seem to work anymore and it is not a good solution (I can't make a clean and restart Eclipse every time I modify my code !).

Did you ever encountered this problem ? How could I solve it ?

Thanks !

Upvotes: 1

Views: 4330

Answers (3)

JohnEye
JohnEye

Reputation: 6895

This happened to me when I ran out of disk space, freeing some space and cleaning the project solved the issue.

Upvotes: 1

youssoua
youssoua

Reputation: 802

Try rebuilding your project from your old existing source

  1. File New
  2. Android Project
  3. choose Create project from existing source
  4. then, below you can go to the repository of your project to select it

I had a similar problem once and it worked for me, I hope it will work for you

Upvotes: 1

Raghu Nagaraju
Raghu Nagaraju

Reputation: 3288

I had similar problem. Just try cleaning the project and rebuild. It will work.

Upvotes: 4

Related Questions