views:

61

answers:

1

Hi

I've just knocked together my first app, have released and signed it and transferred to my phone, but cannot get it to install on my phone - after going through the screen saying 'Do you want to install this application' and clicking install, I just get a message saying 'Application not installed' with no further explanation. I had checked the signing using jarsigner -verify.

I have uploaded the .apk to http://ubuntuone.com/p/ESB/ and obtained the log using the LogCollector app on my phone. The relevant extract is reproduced below.

Log Collector version: 1.1.0
Device model: HTC Desire
Firmware version: 2.2
Kernel version: 2.6.32.15-gf9c0527
htc-kernel@and18-2 )
#1 PREEMPT Fri Jul 23 17:26:53 CST 2010
Build number: FRF91

08-31 10:18:21.289 I/ActivityManager(   93): Starting activity: Intent { act=android.intent.action.VIEW dat=file:///sdcard/blanket.apk typ=application/vnd.android.package-archive cmp=com.android.packageinstaller/.PackageInstallerActivity }
08-31 10:18:21.359 I/PackageParser(20453): uk.co.oketchup.blanketsquare: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
08-31 10:18:21.379 D/skia    (20453): --- decoder->decode returned false
08-31 10:18:21.669 I/ActivityManager(   93): Displayed activity com.android.packageinstaller/.PackageInstallerActivity: 331 ms (total 331 ms)
08-31 10:18:22.059 D/PowerManagerService(   93): New lightsensor value:640, lcdValue:192
08-31 10:18:22.390 D/SynchronizationService(20285): Checking preferences
08-31 10:18:22.769 I/ActivityManager(   93): Starting activity: Intent { dat=file:///sdcard/blanket.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras) }
08-31 10:18:22.849 D/skia    (20453): --- decoder->decode returned false
08-31 10:18:22.999 D/dalvikvm(20459): GC_EXPLICIT freed 419 objects / 23968 bytes in 74ms
08-31 10:18:23.089 D/PackageParser(   93): Scanning package: /data/app/vmdl73677.tmp
08-31 10:18:23.099 I/PackageParser(   93): uk.co.oketchup.blanketsquare: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE
08-31 10:18:23.129 I/ActivityManager(   93): Displayed activity com.android.packageinstaller/.InstallAppProgress: 320 ms (total 320 ms)
08-31 10:18:23.139 W/PackageParser(   93): Exception reading res/layout/main.xml in /data/app/vmdl73677.tmp
08-31 10:18:23.139 W/PackageParser(   93): java.io.IOException
08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:207)
08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.ZipFile$ZipInflaterInputStream.read(ZipFile.java:432)
08-31 10:18:23.139 W/PackageParser(   93): at java.io.FilterInputStream.read(FilterInputStream.java:130)
08-31 10:18:23.139 W/PackageParser(   93): at org.apache.harmony.luni.util.InputStreamHelper.readFullyAndClose(InputStreamHelper.java:174)
08-31 10:18:23.139 W/PackageParser(   93): at java.util.jar.JarFile.getManifest(JarFile.java:307)
08-31 10:18:23.139 W/PackageParser(   93): at java.util.jar.JarFile.getInputStream(JarFile.java:385)
08-31 10:18:23.139 W/PackageParser(   93): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:338)
08-31 10:18:23.139 W/PackageParser(   93): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:509)
08-31 10:18:23.139 W/PackageParser(   93): at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:5961)
08-31 10:18:23.139 W/PackageParser(   93): at com.android.server.PackageManagerService.access$2100(PackageManagerService.java:138)
08-31 10:18:23.139 W/PackageParser(   93): at com.android.server.PackageManagerService$5.run(PackageManagerService.java:4819)
08-31 10:18:23.139 W/PackageParser(   93): at android.os.Handler.handleCallback(Handler.java:587)
08-31 10:18:23.139 W/PackageParser(   93): at android.os.Handler.dispatchMessage(Handler.java:92)
08-31 10:18:23.139 W/PackageParser(   93): at android.os.Looper.loop(Looper.java:144)
08-31 10:18:23.139 W/PackageParser(   93): at android.os.HandlerThread.run(HandlerThread.java:60)
08-31 10:18:23.139 W/PackageParser(   93): Caused by: java.util.zip.DataFormatException: data error
08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.Inflater.inflateImpl(Native Method)
08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.Inflater.inflate(Inflater.java:255)
08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:188)
08-31 10:18:23.139 W/PackageParser(   93): ... 14 more
08-31 10:18:23.149 E/PackageParser(   93): Package uk.co.oketchup.blanketsquare has no certificates at entry res/layout/main.xml; ignoring!
08-31 10:18:23.269 D/dalvikvm(   93): GC_EXPLICIT freed 5970 objects / 337960 bytes in 107ms
08-31 10:18:24.729 I/InstallAppProgress(20453): Finished installing uk.co.oketchup.blanketsquare

Many thanks for your help.


Edit 02/09/2010 I have modified the main.xml file again by removing pretty much all the whitespace. It still does not install but is not quite the same error: it's claiming there is a zip file error although I notice that certificates do appear further down the list. If this is not something I'm obviously doing wrong, would it be better if I raised on android developers mailing list?

09-02 17:33:32.819 W/PackageParser(   93): Exception reading /data/app/vmdl73692.tmp
09-02 17:33:32.819 W/PackageParser(   93): java.io.IOException
09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:207)
09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.ZipFile$ZipInflaterInputStream.read(ZipFile.java:432)
09-02 17:33:32.819 W/PackageParser(   93): at java.io.FilterInputStream.read(FilterInputStream.java:130)
09-02 17:33:32.819 W/PackageParser(   93): at org.apache.harmony.luni.util.InputStreamHelper.readFullyAndClose(InputStreamHelper.java:174)
09-02 17:33:32.819 W/PackageParser(   93): at java.util.jar.JarFile.readMetaEntries(JarFile.java:360)
09-02 17:33:32.819 W/PackageParser(   93): at java.util.jar.JarFile.<init>(JarFile.java:237)
09-02 17:33:32.819 W/PackageParser(   93): at java.util.jar.JarFile.<init>(JarFile.java:218)
09-02 17:33:32.819 W/PackageParser(   93): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:471)
09-02 17:33:32.819 W/PackageParser(   93): at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:5961)
09-02 17:33:32.819 W/PackageParser(   93): at com.android.server.PackageManagerService.access$2100(PackageManagerService.java:138)
09-02 17:33:32.819 W/PackageParser(   93): at com.android.server.PackageManagerService$5.run(PackageManagerService.java:4819)
09-02 17:33:32.819 W/PackageParser(   93): at android.os.Handler.handleCallback(Handler.java:587)
09-02 17:33:32.819 W/PackageParser(   93): at android.os.Handler.dispatchMessage(Handler.java:92)
09-02 17:33:32.819 W/PackageParser(   93): at android.os.Looper.loop(Looper.java:144)
09-02 17:33:32.819 W/PackageParser(   93): at android.os.HandlerThread.run(HandlerThread.java:60)
09-02 17:33:32.819 W/PackageParser(   93): Caused by: java.util.zip.DataFormatException: data error
09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.Inflater.inflateImpl(Native Method)
09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.Inflater.inflate(Inflater.java:255)
09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:188)
09-02 17:33:32.819 W/PackageParser(   93): ... 14 more
A: 

There is some exception being raised while trying to sign the file named main.xml

Exception reading res/layout/main.xml in /data/app/vmdl73677.tmp

Try to delete or recreate that file and then compile/sign and run the application

http://www.google.com/support/forum/p/Android%20Market/thread?tid=11b65a3c2807848a&amp;hl=en

Rahul
I made some minor changes to the file and recompiled/signed. However I get exactly the same error.I don't think I can delete the file because it's needed for the layout.
Tom Sutch
can u try remaining the file and check if the exception is being thrown on the same file
Rahul
I tried renaming it to main2.xml and changing the reference to setContentView. I have now got a slightly different message Exception reading res/layout/main2.xml in /data/app/vmdl73684.tmp java.io.IOException: Invalid attribute 61 at java.util.jar.InitManifest.readName(InitManifest.java:150) at java.util.jar.InitManifest.readHeader(InitManifest.java:115) at java.util.jar.InitManifest.initEntries(InitManifest.java:75) at java.util.jar.Manifest.read(Manifest.java:234) at java.util.jar.Manifest.<init>(Manifest.java:116)[etc]
Tom Sutch
As of now the error still points to the same xml file. It is pointing to main2.xml at this point i am unable to help you better. One alternate approach you can try signing apk directly from Eclipse(using android plug-in)
Rahul
Use the eclipse signer. Just export your app as an android app
Falmarri
Thanks both. I've just tried using Eclipse but sadly I get the same error.
Tom Sutch