Error: APK Preparation Failed

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
NebulousBee
Posts: 5
Joined: Wed Nov 05, 2014 8:47 pm

Error: APK Preparation Failed

Post by NebulousBee » Sat Nov 22, 2014 4:12 am

Hi all,
I just started working with Livecode about three weeks ago. I have created my first program with it for Windows and that was fast and easy. Now I am trying to install that program on my Google Nexus 7 tablet (Android 5.0 Lollipop) but LC is telling me:
There was an error while saving the standalone application
apk preparation failed
Here's what I have done so far:

- Start with Windows 7 64-bit.
- Already had JRE 8.
- Installed Livecode Community 7.0.0 Build 10018.
- Created my stack and it runs very nicely in Windows.
- Install the newest Android SDK (as of yesterday) - 23.0.2.
- Opened the Android SDK Manager, as the Guide here suggests and added the older versions to the installed components.
- I now have Android SDK Tools v23.0.5, Android SDK Build Tools v20, Android APIs for 5.0 (21), 4.4.2 (19), 4.1.2 (16), 2.3.3 (10) and 2.2 (8) installed on this workstation.
- Created a HelloWorld app in he Android / Eclipse IDE and loaded that onto my Nexus 7. It works!
- In LC, set the Preferences > Mobile Support > Location of Android SDK Root folder.
- That was accepted but the JDK path below that remained blank.
- I realized I had the JRE not the JDK, so I downloaded and installed JDK 8 U25, which included the JRE 8 U25
- Now in the Preferences, I see the correct path to my JDK folder so that's all set.
- I setup the standalone settings for my LC program, using ALL of the default field values expect for giving it a name.
- I selected Development > Test Target and then selected what I assume is my Nexus 7, it says "Android 015d8jh345243256" (or similar)
- I select Save As Standalone Application... and then select a folder and it says "Building Classes..." and then "Preparing Packages" and then fails with this error (above).
- I tried using the Test button instead, but get the same error.
- I read quite a few other forum posts here and tried a few of those solutions, including placing the zipalign.exe from LC Support in my sdk\tools folder, and removing my users\myname\.android folder or just the debug.keystore file I see in there, but no go. Same error.
- I tried creating a new program, with just "Hello" in a plain label on the main stack, but get the same error when I try to Test and when I try to build the standalone application.

Whew, that's a lot of steps! :-)

Does anyone know if I need to include an "Icon" in my standalone settings? That field and "splash" are blank right now.

Sorry this is so long. I am really loving LiveCode so I hope I can make this work. FYI, this little program I am writing is just for me and I am just a hobbyist. Thanks for any help anyone might be able to offer.

UPDATE: I'm making this longer! I just tried testing with my HTC One Mini Android 4.2.2 phone instead of the Nexus 7 tablet. Again, I tested with just Android first and I was able to install a program from Eclipse just fine. In LC though, same exact error as before.

Are there more detailed logs I can review somewhere in LC or my Android setup?

Thanks again for any help folks.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Error: APK Preparation Failed

Post by LCNeil » Sat Nov 22, 2014 3:58 pm

Hi NebulousBee ,

This was a known is and was resolved in LiveCode 7. (7.0.1 RC2)

Please download and install this version and try building for Android again.

You will be able to download the latest version of LiveCode from your store account or our main downloads repository here-

http://downloads.livecode.com/livecode/


Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--

NebulousBee
Posts: 5
Joined: Wed Nov 05, 2014 8:47 pm

Re: Error: APK Preparation Failed

Post by NebulousBee » Sat Nov 22, 2014 4:23 pm

The update fixed my problem. Thanks very much, Neil!!!

:D

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Error: APK Preparation Failed

Post by sphere » Sun Nov 30, 2014 2:01 pm

Hello,

i have the same problem here.
With the keystore tool i tried several things, instead of tictactoe i putted in the name of the app. As it is rather unclear what it should be. Also tictactoe don't work.
A key is made quite easy with the tool in the bin folder of the java jdk.
I used an older Android sdk build as mentioned in an other post and did not install any builder higher then 20. As above and 21 should give problems.
FIrst i used the latest available but it gave similair faults.

As i noticed the failure comes up rather you point to the keystore file or not, so the problem must lie somewhere with the Androis SDK i believe or with LC 7 stable.

Has any one have a kind of fail safe setup for this as the lessons don't cover it completely which Android Builds to install and which not.

Thanks for any help on this.

edit--- ok should be fixed in the 7 rc1 and rc2 versions---

now with a simple button to test i get a "there was a problem parsing the package"error on real devices

Post Reply

Return to “Android Deployment”