Unable to build app for testing

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
darrychui
Posts: 7
Joined: Mon May 09, 2011 3:01 pm

Unable to build app for testing

Post by darrychui » Thu May 26, 2011 11:35 pm

I am trying to test on a android virtual device. I followed the documentation.
1) installed live code 4.6.1
2) installed Android sdk and JDK
3) created a virtual devices in the adroid sdk and avd manager and start the device.
4) configured the livecode preference "mobile support" android development sdk root.
5) selected the test target.

When I hit the test button, the message "Unable to build app for testing: could not compile application class".
Any idea what I am doing wrong.

Thanks
Darry

webmaster
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 81
Joined: Mon May 09, 2011 3:01 pm

Re: Unable to build app for testing

Post by webmaster » Fri May 27, 2011 2:05 am

The steps you list sound good. That's pretty much what I've done and it is working for me.
Make sure you are targeting a virtual Androird OS version of 2.2 or higher.

Have you tried creating a very simple 1 stack 1 card application (text/rectangles/buttons -- no code) to make sure it's not something particular to the coding in your app?

--ForrestD

darrychui
Posts: 7
Joined: Mon May 09, 2011 3:01 pm

Re: Unable to build app for testing

Post by darrychui » Fri May 27, 2011 7:28 am

Yes, it is targeting a virtual android device platform 2.2 API Level 8.
My test livecode is 1 stack with 1 control and no code.
By the way, under the preferences/mobile support section. The JDK Path: (none). Is this normal?

Also, I installed it on another machine and this time, the test target "Android emulator - 5554" is grey out. I can't selected.

Any ideas?

jharris
Posts: 84
Joined: Wed Jan 26, 2011 3:28 am
Location: Arkansas - USA

Re: Unable to build app for testing

Post by jharris » Fri May 27, 2011 1:40 pm

I had this problem also. I am running 64bit Windows 7.

I had the wrong version of Java Installed. I removed the version I had installed. It was installed in Program Files (x86).

I installed jdk-6u24-windows-x64.exe and it installed in C:\Program Files\Java\jdk1.6.0_24 by default.

Start LiveCode and it should now show the path to JDK. It should work now at least it did for me.

Good Luck

jharris
Operating System: macOS Monterey Version 12.5
LiveCode Version: 9.6.8

darrychui
Posts: 7
Joined: Mon May 09, 2011 3:01 pm

Re: Unable to build app for testing

Post by darrychui » Fri May 27, 2011 4:44 pm

That did it.
Thanks JHarris...

jharris
Posts: 84
Joined: Wed Jan 26, 2011 3:28 am
Location: Arkansas - USA

Re: Unable to build app for testing

Post by jharris » Fri May 27, 2011 5:10 pm

No problem... I spent several hours trying to figure that one out.

jharris
Operating System: macOS Monterey Version 12.5
LiveCode Version: 9.6.8

lelitton
Posts: 1
Joined: Wed May 24, 2006 7:31 pm
Location: Grass Valley, CA, USA
Contact:

Re: Unable to build app for testing

Post by lelitton » Sat May 28, 2011 11:48 pm

getting "apk preparation failed" message, the pref's seem in order, is this a setup problem with the Adroid sdk or LiveCode?

gimpeltf
Posts: 29
Joined: Wed Nov 08, 2006 5:14 pm

Re: Unable to build app for testing

Post by gimpeltf » Wed Jun 15, 2011 5:53 pm

I'm having the same problem (apk preparation failed)

Running on Windows xp
Gimp

Desktop 32 bit Windows XP SP3-Laptop 64 bit Windows 7
4.6.1 Build 1392- Android Personal
HTC Thunderbolt 2.2

jharris
Posts: 84
Joined: Wed Jan 26, 2011 3:28 am
Location: Arkansas - USA

Re: Unable to build app for testing

Post by jharris » Thu Jun 16, 2011 2:20 pm

I've not seen the error, but a quick google search suggests the problem may be with the android sdk. I would google it if no other suggestions are offered.
I found this on a google search... not sure if it will help or not.
Improper Windows system locale cause Eclipse to not build the APK file.

The problem seems to be affected with any project that is created when the
Windows system locale/location is not English, United States.

The most simplest project as "Hello Android" also suffering from this problem.
jharris
Operating System: macOS Monterey Version 12.5
LiveCode Version: 9.6.8

hmeheather
Posts: 1
Joined: Mon May 21, 2012 3:23 pm

Re: Unable to build app for testing

Post by hmeheather » Mon May 21, 2012 3:30 pm

Can you test in an Android sim with the trial? Or do you have to have the full licensed copy? I am having the "apk preparation failed" error with my trial. I have uninstalled and reinstalled Android SDK 3 times undated to rev 19, I have JAVA JDK1.6.0_32 and am using Android ver 2.2 and still get the error. System is Windows 7. I'd like to have a full test before I go to my boss to purchase this software, which I think is very simple and useful but would be an easier sell if I had a sample to show. Thanks

Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Re: Unable to build app for testing

Post by Gene » Sun Jun 17, 2012 8:14 pm

I'm getting the same "Unable to build app for testing: apk preparation failed" message when trying to test on my Android device.

However, this is just now appearing. I'm getting back into development after having not worked with LiveCode for a couple of months, and now this shows up out of the blue. I'm trying to work with a project that tested just fine when I last used LiveCode, and I haven't changed anything since then.

Does anybody have any ideas, or has anybody experienced the same thing since the last posts? I don't know where to start on fixing this.

Thanks,

Gene

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7266
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Unable to build app for testing

Post by jacque » Mon Jun 18, 2012 9:23 pm

This can be due to an issue with the .android file, which is a hidden file at the root of the user folder (on a Mac, anyway.) Deleting that file and restarting the emulator fixes it. You'll have to use Terminal or some other app that will work with hidden files to both find it and remove it. The file can become invalid for a number of different reasons.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Location: Fredericktown, MO
Contact:

Re: Unable to build app for testing

Post by ctflatt » Fri Jun 22, 2012 1:59 am

Jacque:

You are wonderful! I have been experiencing this issue and noted your solution.

Downloaded "Houdini" to view hidden files/folders and deleted the hidden .android... LiveCode's working like a champ now...

Thanks, again!

:Todd

Post Reply

Return to “Android Deployment”