"Test" and "Test Target" are grayed out

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

bcreitz
Posts: 6
Joined: Sat Aug 13, 2011 8:33 pm

"Test" and "Test Target" are grayed out

Post by bcreitz » Sat Aug 13, 2011 8:59 pm

Just installed a trial of LC, then installed the Android SDK per the LiveCode Lesson. "Test" and "Test Target" menu items are grayed out. I can fire up a virtual device via the Android emulator, or I can have my physical Android phone (in USB debugging mode) plugged in... the menu items remain disabled.

A couple of other notes:
- "JDK:" field is blank in the preferences dialog. Should that be?
- I have made a testing key using the keystore tool and set LC to use it to sign the app
- I cannot build a standalone Android app; I get the message "There was an error while saving the standalone application - could not encode class bundle"

LC 4.6.3 build 1445
OS X Snow Leopard 10.6.8

Thanks in advance!

Ben
Last edited by bcreitz on Tue Aug 16, 2011 10:32 pm, edited 1 time in total.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: "Test" and "Test Target" are grayed out

Post by Mark » Sat Aug 13, 2011 10:22 pm

Hi Ben,

You need to start up the virtual Android device before you start LiveCode. Make sure that the virtual device has started completely. This may take a few minutes. Don't start LiveCode too early. Sometimes I have to restart LiveCode and Android 2 or 3 times before they find each other. I wish LiceCode would show some error messages if something goes wrong.

Only Android 2.2 (Level 8) works. In the preferences, you need to point LiveCode to the root of your Android SDK. This field should not be blank. After changing the preferences, you might need to restart LiveCode.

You have to make sure that the virtual device is snapshot-enabled. This is essential.

You don't need a key for testing in the emulator but you need it for testing with a real device. I don't know why you're unable to encode the class bundle. This might be due to a problem with the key file(?).

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bcreitz
Posts: 6
Joined: Sat Aug 13, 2011 8:33 pm

Re: "Test" and "Test Target" are grayed out

Post by bcreitz » Sun Aug 14, 2011 5:32 pm

Thanks Mark. After re-browsing to my Android SDK in the prefs pane, the path to the JDK magically appeared. From there on out I could reliably set my test target to the emulator or the phone. However, I still get the error about not being able to encode the class bundle :( .

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: "Test" and "Test Target" are grayed out

Post by Mark » Sun Aug 14, 2011 5:42 pm

bcreitz,

The encoding problem might be a bug. Perhaps you should contact support.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

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

Re: "Test" and "Test Target" are grayed out

Post by jacque » Sun Aug 14, 2011 6:31 pm

bcreitz wrote:Thanks Mark. After re-browsing to my Android SDK in the prefs pane, the path to the JDK magically appeared. From there on out I could reliably set my test target to the emulator or the phone. However, I still get the error about not being able to encode the class bundle :( .
What happens if you choose the key file for development, which lets the engine create a generic one for you? If that works, the problem is probably in your key file.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bcreitz
Posts: 6
Joined: Sat Aug 13, 2011 8:33 pm

Re: "Test" and "Test Target" are grayed out

Post by bcreitz » Mon Aug 15, 2011 3:43 am

Unfortunately, even after choosing "sign for development only", I still get the error.

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

Re: "Test" and "Test Target" are grayed out

Post by jacque » Mon Aug 15, 2011 5:07 am

That's too bad. At least it rules out a problem with your key. I agree, you should probably ask support about it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bcreitz
Posts: 6
Joined: Sat Aug 13, 2011 8:33 pm

Re: "Test" and "Test Target" are grayed out

Post by bcreitz » Tue Aug 16, 2011 4:52 pm

I contacted support. They sent me a file to replace in my Android SDK:
dx.zip
New dx file from LC support to replace .../platforms/android-8/tools/dx
(1.71 KiB) Downloaded 532 times
... and it worked. Here's the recap:

- I'm on Mac OS X and when trying to deploy to an Android phone or AVD, I got the message: "Unable to build app for testing: could not encode class bundle"
- The solution: download and unzip the attached file. Use it to replace the dx file found in <path to android sdk>/platforms/android-8/tools/
- Set the new dx file to be executable: From Terminal, cd to the platforms/android-8/tools/ directory in your Android SDK, then run "chmod +x dx".

After following these steps I was able to deploy to Android!

Ben

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

Re: "Test" and "Test Target" are grayed out

Post by jacque » Tue Aug 16, 2011 6:40 pm

Thanks for posting that -- it will help a lot of people.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: "Test" and "Test Target" are grayed out

Post by marksmithhfx » Tue Aug 16, 2011 9:49 pm

bcreitz wrote:Use it to replace the dx file found in <path to android sdk>/platforms/android-8/tools/
- Set the new dx file to be executable: From Terminal, cd to the platforms/android-8/tools/ directory in your Android SDK, then run "chmod +x dx".
Ben
Hi Ben, sorry I am not familiar with the command line in Terminal (although I am familiar with MS-DOS dir, cd etc ). I typed in the following but I don't think it worked because the icon is still generic and does not look executable (ie. does not look like the one I just replaced, it is just a plain white unmarked icon). Can you suggest what I might try (and also, is there a users guide or get acquainted manual for the Terminal)?

Mark-Smiths-MacBook-Pro:~ Mark$ cd Mark Smith's Macbook Pro/Macintosh HD/android-sdk-mac_x86/platforms/android-8/tools/
> chmod +x dx
> dir
>

Thanks

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: "Test" and "Test Target" are grayed out

Post by Mark » Tue Aug 16, 2011 9:54 pm

Hi Mark,

That won't work because of the spaces. Edit: no, on second thought, I don't know why it doesn't work. What you did looks correct to me. Try the following anyway (it is still worth trying):
1) rename the old DX into e.g. "DX old"
2) copy the new DX file to the right location, putting it next to the old one
3) open a (new) terminal window
4) type "chmod 755 " (without quotes, the last char is a space)
5) drag the new DX file (which is now in the right place) into the terminal window
6) press return or enter
7) there is no step 7

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: "Test" and "Test Target" are grayed out

Post by marksmithhfx » Tue Aug 16, 2011 10:30 pm

I'm going to answer my own question since I found a good guide to terminal on the net:

http://guides.macrumors.com/Terminal

One crazy trick I learned from that is you can drag any Mac file onto the terminal and it will give you the complete path. When I dragged the dx file onto the terminal it displayed

/android-sdk-mac_x86/platforms/android-8/tools/dx

Armed with that handy bit of information I was able to type cd /android-sdk-mac_x86/platforms/android-8/tools/

typing ls gave me

NOTICE.txt dexdump llvm-rs-cc-2
aapt dx llvm-rs-cc.txt
adb lib source.properties
aidl llvm-rs-cc
Mark-Smiths-MacBook-Pro:tools Mark$

which basically told me I was in the right place. Sorry, I am repeating all of this in case there any other terminal newbies in the crowd. Anyway, typing the other commands you supplied worked great (actually I had the tools window open in OSX and watched the icon change in real time.... that was cool). Have not tested Android yet but thought I would share this while I was in the midst of it (and before anyone else wasted time answering my question).

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: "Test" and "Test Target" are grayed out

Post by marksmithhfx » Tue Aug 16, 2011 10:38 pm

Mark wrote:Hi Mark,

That won't work because of the spaces. Edit: no, on second thought, I don't know why it doesn't work. What you did looks correct to me. Try the following anyway (it is still worth trying):
1) rename the old DX into e.g. "DX old"
2) copy the new DX file to the right location, putting it next to the old one
3) open a (new) terminal window
4) type "chmod 755 " (without quotes, the last char is a space)
5) drag the new DX file (which is now in the right place) into the terminal window
6) press return or enter
7) there is no step 7

Best,

Mark
Thanks Mark... you beat me before I posted my own reply. I like the way you combined chmod 755 with dragging the file onto Terminal from the OSX window (which would complete the path to the file). What does chmod 755 do? same thing as chmod +x? Your approach is much simpler than mine... I think I could have done it in three steps (maybe??)

1. open the terminal window and type chmod +x (there is a space after the x)
2. Then drag the dx file from the OSX window onto the terminal
3. press return

I don't want to try this now (too afraid to mess it up) but do you think it would have worked? (I will probably run into this situation again and having this thread here will be useful for going back to).

Thanks Mark

-- Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: "Test" and "Test Target" are grayed out

Post by Mark » Tue Aug 16, 2011 10:51 pm

Hi Mark,

You're basically repeating what I wrote, so yes it will work.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: "Test" and "Test Target" are grayed out

Post by marksmithhfx » Tue Aug 16, 2011 11:06 pm

Mark wrote:Hi Mark,

You're basically repeating what I wrote, so yes it will work.

Kind regards,

Mark
Thanks Mark.... and thanks to Ben (and Support) and everyone for their assistance with this. I've got it all working (finally!) and have updated my signature line (... what an ordeal that was :shock: )

One final thing... the Android sim is pretty big, actually it runs off the bottom of the screen (see attached). I have controls down there I cannot reach. Any suggestions for shrinking it up a bit??

Thanks

-- Mark
Attachments
Screen shot.jpg
Last edited by marksmithhfx on Tue Aug 16, 2011 11:22 pm, edited 2 times in total.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

Post Reply

Return to “Android Deployment”