"Application not installed" on Android when including resources in the apk?
I'm developing a graphical application for Android tablets but I've recently started having a strange problem. The application runs fine on the emulator, but whenever I try to install it on the tablet (a Zenithink ZT-180 tablet running Android 2.2), I get the "Application not installed" error.
I've tried to narrow the problem down and it seems it may be somehow related to the provided resources. I commented out all use of bitmaps in the application, and removed all bitmaps except the icon from the "res/drawable" directory, and compiled the application. That version installed without errors. Next, I placed a single additional bitmap (1024*1000 png, 1.15Mb) in the "res/drawable&开发者_开发百科quot; directory - I did not load it in the code or anything, I just placed the bitmap in the directory and recompiled the application. This time, the installation failed with the "Application not installed" error.
This seems rather strange to me - how can a single new bitmap in the resources mess up the installation, when it isn't even used by the application? Any insight would be appreciated!
Update due to mibollma's comment:
I installed it by copying the .apk file from the PC onto a USB disk, inserting the USB disk into the tablet, and activating the .apk installer from the USB disk using the tablet's file explorer. (At a slighly different point in my debugging I tried to copy the .apk first onto the tablet's internal memory storage, but that didn't help at least at that time.)
Note that the simple application (the one that doesn't have any images besides the icon) does install fine like this, as does the basic "Hello Android" application. The trouble apparently happens when I try to add more graphics into the resources...
I did not specify installLocation or any special options in the manifest.
I haven't been able to figure out what caused the problem, but I was able to remove it by basically reinstalling Eclipse and the Android toolkit, and then recreating the application from the existing sources.
(For future reference: Before I did the reinstall, I did try things like changing the 'debuggable' and 'test only' attributes in the manifest, and checking that the minSDK version matched the specified target, but that did not help. The problem even occurred in the simple "Hello, Android" application - I just placed a bitmap in the resources directory for "Hello, Android" and the resulting .apk did not install correctly. The problem might have been some mixed-up setting either in the toolkit, Eclipse, or in the project configuration, I still don't know.)
精彩评论