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
Why APK won't install on Android? First, make sure that your Android version supports the APK version you want to install. Also, remove the Play Store version of the app before installing an APK. Don't forget to check the storage space and permission to install apps from unknown sources.
Just open your browser, find the APK file you want to download, and tap it – you should then be able to see it downloading on the top bar of your device. Once it's downloaded, open Downloads, tap on the APK file and tap Yes when prompted. The app will begin installing on your device. Simple.
Depending on your device, you might need to give a specific app, such as Chrome, permission to install unofficial APK files. Or, if you see it, enable Install Unknown Apps or Unknown sources. If the file doesn't open, try browsing for it with a file manager like Astro File Manager or ES File Explorer File Manager.
I've seen corrupted .apks that won't load on a device, with weird IOExceptions. Following these steps in Eclipse seems to prevent the problems I've seen:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With