Unable to build app for testing: apk preparation failed

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

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
brotee
Posts: 30
Joined: Sat Mar 12, 2016 9:15 am

Unable to build app for testing: apk preparation failed

Post by brotee » Mon Jul 16, 2018 9:29 pm

Any solutions for this? i have deleted .android, i dont have accents in file names, its the same if i try with an empty stack too..

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 507
Joined: Fri Feb 06, 2015 4:03 pm

Re: Unable to build app for testing: apk preparation failed

Post by LiveCode_Panos » Mon Jul 16, 2018 9:48 pm

Hi brotee,

Which version of LC are you using, and in which platform?

Moreover what is the version of your Android SDK Tools, SDK Build Tools, and SDK Platform Tools?

Best,
Panos
--

brotee
Posts: 30
Joined: Sat Mar 12, 2016 9:15 am

Re: Unable to build app for testing: apk preparation failed

Post by brotee » Mon Jul 16, 2018 9:54 pm

i have tried LC 9.01 9.0 8.1.9

windows 7

SDK platforms installed: 2.2, 4.03, 4.4, 5.1, 8.0
SDK build tools i have tried 22.0.1, 26.00, 28.01
SDK platform tools: 28.0.0
SDK tools: 26.1.1

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 507
Joined: Fri Feb 06, 2015 4:03 pm

Re: Unable to build app for testing: apk preparation failed

Post by LiveCode_Panos » Mon Jul 16, 2018 10:12 pm

Hmm strange. I am not sure why you get that error. Can you please try the following in LC 9.0.1 RC-1:

1. Open the msg box
2. Type

Code: Select all

put true into gRevDevelopment
3. Type

Code: Select all

edit the script of stack revSaveAsAndroidStandalone at 912
The script editor should open now, showing the script of the stack you requested.

4. Find line

Code: Select all

buildAPK tUnalignedApkFile, tUnsignedParam, tAssetArchive, tClassesFile, tLibsBuildFolder
(should be line no 912)

5. Add a breakpoint to this line.
6. Find line

Code: Select all

throw "apk preparation failed"
(should be 917) and change it to:

Code: Select all

throw "apk preparation failed" &  the result
7. Click the "Apply" button (top left)
8. Try to save again as an android standalone

9. The execution should now stop at the breakpoint you added
10. Click on the "Step over" button, until the updated line is executed.

What is the new error message? Hopefully it should be more informative.


Best regards,
Panos

brotee
Posts: 30
Joined: Sat Mar 12, 2016 9:15 am

Re: Unable to build app for testing: apk preparation failed

Post by brotee » Mon Jul 16, 2018 10:18 pm

yes it is :)

it would be great if error messages would be informative

message was:

"failederror opening registry key
'Software\JavaSoft\Java Runtime Environment'

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 507
Joined: Fri Feb 06, 2015 4:03 pm

Re: Unable to build app for testing: apk preparation failed

Post by LiveCode_Panos » Mon Jul 16, 2018 10:28 pm

Thanks, this is helpful. Which version of Java have you installed? Note that Java 9 and 10 will not work, you need Java 8.

brotee
Posts: 30
Joined: Sat Mar 12, 2016 9:15 am

Re: Unable to build app for testing: apk preparation failed

Post by brotee » Mon Jul 16, 2018 10:32 pm

Yep, i have read the posts before about this topic and i had 8.171

i have uninstalled every java, and deleted the whole directory.. and reinstalled 8.171 only and now it works

ty for your helping :)

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 507
Joined: Fri Feb 06, 2015 4:03 pm

Re: Unable to build app for testing: apk preparation failed

Post by LiveCode_Panos » Mon Jul 16, 2018 10:44 pm

You are welcome ;)

Post Reply

Return to “Android Deployment”