Error when parsing a custom apk file-Collection of common programming errors

I started to look into Android programming today and created a very small app that is supposed to play MP3s. The tools I used where the Android SDK and eclipse. The code executed flawlessly in the Android emulator but after exporting it and attempting to install the apk on my Samsung Galaxy S2 I received a message telling me there was an error when parsing the file.

Here is my phone’s configuration: Android v2.3.3, installation from unknown sources = allowed, USB-Debugging = enabled. The target system for my project has been set to Android v2.3.3 as well and the CPU architecture of the AVD has been set to ARM (armeabi).

I signed the apk using a custom keystone when exporting it, as I initially thought the problem might be a debug key which wouldn’t work on real devices.

I attempted to install the app using both, the internal file explorer and a custom explorer (ES File Explorer) but it didn’t work for.

Suggestions on how to make my phone execute my custom apps would be highly appreciated. 🙂

  1. First, since it’s complaining about the .apk file, try opening the .apk file by renaming the extension to .zip. If you can rename the file, and open it normally in Windows Explorer, then that should indicate the file itself isn’t corrupt.

    Secondly, I would try installing by connecting your device via usb and using the command adb -d install "path-to-your-apk-file.apk". If this doesn’t work, hopefully adb will spit out something more descriptive, and you can update your question with the error.

  2. I found the answer to the parsing error on custom apk files here. Removing the required API level tag android:minSdkVersion in AndroidManifest.xml solved the problem.