5

I am using Eclipse Ganymede with ADT 10.0 plugin and Android3.0 SDK to build my application.

When i try to deploy the application on my phone I get the following written on my console:

[2011-05-06 10:35:38 - MyProject] Failed to install MyProject.apk on device 
[2011-05-06 10:35:38 - MyProject] (null)
[2011-05-06 10:35:38 - MyProject] Launch canceled! 

and the following is written to adb logcat:

INFO/zipro(2499): Could not find end-of-central-directory in Zip
DEBUG/asset(2499): failed to open Zip archive '/data/local/tmp/MyProject.apk'
WARN/PackageParser(2499): Unable to read AndroidManifest.xml of /data/local/tmp/MyProject.apk
WARN/PackageParser(2499): java.io.FileNotFoundException: AndroidManifest.xml
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:523)
WARN/PackageParser(2499):     at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:491)
WARN/PackageParser(2499):     at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:597)
WARN/PackageParser(2499):     at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:126)
WARN/PackageParser(2499):     at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:100)
WARN/PackageParser(2499):     at android.os.Binder.execTransact(Binder.java:288)
WARN/PackageParser(2499):     at dalvik.system.NativeStart.run(Native Method)
ERROR/PackageManager(1579): Failed to handle start copy. Giving up
ERROR/PackageManager(1579): java.lang.NullPointerException
ERROR/PackageManager(1579):     at android.os.Parcel.readException(Parcel.java:1253)
ERROR/PackageManager(1579):     at android.os.Parcel.readException(Parcel.java:1235)
ERROR/PackageManager(1579):     at com.android.internal.app.IMediaContainerService$Stub$Proxy.getMinimalPackageInfo(IMediaContainerService.java:220)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$InstallParams.handleStartCopy(PackageManagerService.java:5065)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$HandlerParams.startCopy(PackageManagerService.java:4954)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:476)
ERROR/PackageManager(1579):     at com.android.server.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:421)
ERROR/PackageManager(1579):     at android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/PackageManager(1579):     at android.os.Looper.loop(Looper.java:143)
ERROR/PackageManager(1579):     at android.os.HandlerThread.run(HandlerThread.java:60)

When I try to install it using adb shell from cmd prompt I get:

EOCD not found, not Zip
file 'D:\Workspace\MyProject\bin\MyProject.apk' is not a valid zip file

I have tried cleaning the project/ deleting the gen folder / deleting the debug keystore. Nothing worked;

Please advise.

Samuh
  • 36,316
  • 26
  • 109
  • 116
  • Something is clearly corrupting your .apk file. Have you tried doing an `ant clean` and rebuilding from scratch? – trojanfoe May 06 '11 at 15:08
  • Eclipse does the building for me; I dont use ant. The build tools are not able to package everything into a valid apk archive. Other projects compile okay except just this one. I tried recreating a new Android Project by copying the source code but that did not work either. – Samuh May 06 '11 at 15:13
  • I am getting the same error ("Unable to read AndroidManifest.xml") but the apk is definitely a valid zip file and the error message from adb install is different: "Failure [INSTALL_FAILED_ALREADY_EXISTS]" -- strange, it's never had difficulty installing over an existing copy before. Uninstalling from the Android UI (Settings => Apps) allowed it to finally reinstall. – Qwertie Nov 21 '12 at 19:51

4 Answers4

1

See this thread they solved the issue : can't launch the application from eclipse

Uday
  • 5,933
  • 9
  • 44
  • 76
1

I had a similar problem and was getting similar logs in eclipse console

[2011-12-06 10:35:38 - MyProject] Failed to install MyProject.apk on device 
[2011-12-06 10:35:38 - MyProject] (null)
[2011-12-06 10:35:38 - MyProject] Launch canceled!

But cleaning and rebuilding the project solved the problem.

Vasu
  • 4,862
  • 8
  • 42
  • 48
0

I had a similar problem. I had copied a zip file into the source folder:-e.g;the package was com.example.demo

and I had put the file in com folder. It showed me the same error as you get. I'm Not sure about ur case but before writing the code again, just check the whole project if something has gone wrong by mistake!!

Jaydeep Khamar
  • 5,975
  • 3
  • 32
  • 30
0

Seems like Ganymede is not compatible with ADT 10.0

From http://developer.android.com/sdk/requirements.html :

Supported Development Environments Eclipse IDE

* Eclipse 3.5 (Galileo) or greater

  Note: Eclipse 3.4 (Ganymede) is no longer supported with the latest version of ADT.
Yink
  • 53
  • 4