LiveCode and Android Studio

As of LiveCode 8.1.5 you can use Android Studio with LiveCode to set up Android deployment.

You need to download and install Java SDK version 8, if you already have Java 9 or 10 installed you will need to uninstall these and reinstall Java 8. You can download Java 8 here.

You will need to download the Android Studio SDK, here.

Ensure you are running as Admin on Windows, or you may get a permissions error when trying to use your installed SDK.

 

Opening the SDK Manager

Begin by starting up Android Studio.

LiveCode requires certain package to be installed. To open the SDK Manager, which allows additional packages to be installed select SDK Manager from the Configure menu on the Android Studio opening screen.

Installing the required packages

The Android SDK Manager lets you select the packages you would like to install in your Android development environment. By default, only a few packages are selected. Select the required package for your version of LiveCode. You can have other packages installed too, these are just the required packages.

  • < LiveCode 9.0.1:  Android 4.0.3 (IceCream Sandwich) - API 15
  • LiveCode 9.0.1 - LiveCode 9.0.5: Android 8.0 (Oreo) - API 26
  • LiveCode 9.5.0+: Android 9.0 (Pie) - API 28

Click the Apply button to install the packages.

Note: you can see the Android SDK location at the top of the Window, take a note of this as you will need it in the next step.

Update: Android Studio 3.6 has stopped to install the android command line tools by default. These tools were stored in the /Users/youruser/Library/Android/sdk/tools folder, and contained some necessary jar files that are needed to build for Android.

You can still force Android Studio 3.6 to download these tools:

- Launch Android Studio and go to Configure -> "SDK Manager"

- In the new window open "System Settings -> Android SDK".

- From there pick the tab "SDK Tools".

- Uncheck the "Hide Obsolete Packages" option in the bottom of the window.

- Now there should appear a new option: "Android SDK Tools (Obsolete)" - check that, hit "Apply" - it will download the files and "Tools" folder will appear in the /Users/youruser/Library/Android/sdk/ folder:

Configuring LiveCode for Android Support

By now, you should have successfully installed the required software in your development environment. The next step is to launch LiveCode and configure it to interface with the Android SDK.

Launch the LiveCode IDE and select Edit -> Preferences to launch the Preferences menu. Then select Mobile Support and you are presented with the dialog shown in this step.

This dialog allows you to configure the path to the Android SDK root, which you should already have installed. Select ... under Android SDK and choose the folder containing the Android SDK root.

Validation checks are made once you specify the location of the Android SDK root. This ensures that you have selected a valid location and have the required Android components installed.

The following error message may be raised if something is wrong with your set up:

The chosen folder is not a valid Android SDK. Please ensure you have installed it correctly, and enabled support for Android 4.0.3.

This indicates that the path you specified is not pointing at the Android SDK root. You may have to navigate one level deeper into the folder hierarchy to access the root folder. The root folder may look something like: ...android-sdk-windows.

The Android SDK might have been installed into a hidden folder, meaning you can't browse to it. Showing hidden files and folders should allow you to browse to the SDK root.

Deploying to an Android device or Emulator

Now you have your LiveCode Android preferences set up you can deploy to an Android device or emulator.

Configuring a Virtual Device

Once you have installed the required packages, you can use the Android AVD Manager to set up a virtual device that can be used in your development environment. This allows you to test your applications without requiring a physical Android device.

To set up a virtual device:

  • Open Android Studio
  • Create a blank project
  • Open the AVD Manager by clicking the AVD Manager button in the tool bar
  • Select "Create Virtual Device"
  • Follow the steps to create a virtual device. The arm emulators are slow, so we recommend using x86.
  • Click the Launch button under Actions to start the virtual device.

Configuring a Physical Device

In addition to setting up virtual devices, it is possible to set up physical devices. These devices can be accessed after they have been appropriately configured for debugging.

Install the appropriate device drivers for the devices you would like to use. Details of how to do this can be found at the Android Developer Website.

The relevant device must be set to debug mode, once the necessary drivers are installed. To enable debug mode, please see your manufactures recommend instructions for doing so. An example for a Galaxy S3 running Android 4.1.1 is-

  1. Go to Settings > About > Software Information > More
  2. Now scroll to  Build Number and tap it7 times repeatedly. After tapping the build number 5 times you'll see a message Press it two more times to be a developer and after tapping 7 times you'll see message You are now a developer or Developer mode has been enabled
  3. Navigate to Settings> Developer options
  4. Check option for Android Debugging

Testing on a Virtual or Physical Device

You should now have set up your development environment for Android and are ready to test a LiveCode application on an Android device.

Ensure the emulator is running or an adequately configured physical device is connected before trying to test your code. Then select a device from Development -> Test Target. The Test icon on the main pane of the LiveCode IDE should now be active and allow you to deploy your LiveCode application.

Note: When deploying to a device, you may receive a "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES" message. All this means is that there is currently an application installed on your device that has the same identifier as the app you are trying to deploy. This can happen if you are working on a specific app across multiple development machines.

To resolve this issue you can do one of the following

  • remove the existing application from the device you are deploying to
  • change the app identifier in the standalone applications settings

65 Comments

Nelson

I tried configuring the Android SDK without luck. Installed Java in the same directory and the Android SDK and the same message appears. The Android SDK installed is the 4.0.3 using the Android Studio. The Java is the latest version. Any help on this?

Tom Bodine

Be sure you have LiveCode 8.1.5 or later. Older tutorial lessons have directions that may not work for the latest LiveCode. (You didn't say what error message you are getting, so hard to give specific advice.)

Christopher Flatt

Should this work on Mac OS X Sierra, with Livecode 8.1.4? I'm not having success here...

Panos Merakos

Hi all,

As Tom said, this lesson will only work with LiveCode 8.1.5 RC-1 or later.

Best,
Panos
--

Tom Bodine

Hi,
I have 8.1.5 (on Windows) configured with the Android sdk and java path is populated. And I've created a virtual machine with AVD Manager. However, the "test" and "test target" menu items remain grayed out, as does the toolbar's "Test" icon. What is the trick to making LC use an Android virtual device in LC 8.1.5?

Panos Merakos

Hi Tom,

You have to open a stack, and select "Android" in the standalone application settings. This should enable the "Test Target" and "Test" options.

Tom Bodine

Still not working. I tried two approaches:
1) Opened an AVD. Then opened LC 8.1.5 (rc1), opened a stack, selected only the Android build options, confirmed Android SDK selected in Preferences. But all "Test" options remained grayed out.
2) Reset test by quitting the AVD and LC. This time, opened LC 8.1.5 first. (All Test menus grayed out.) Confirmed Prefs > Mobile Support show the Android SDK and JDK paths. Confirmed Standalone App. Settings is checked only for Android build. ("Test" menus still grayed out.) Then opened Android Studio and launched AVD Manager, selected my AVD and launched it. AVD fully loads, but LC test menus remained grayed out.

Advice?

Tom

Panos Merakos

Hi Tom,

Hmm that's strange. Sometimes the "Test" button of the LC menubar is greyed out for me too (although I have the proper setup). However, if I just click on it, it is enabled. If you have not done this already, I suggest you give it a try.

BTW which version of Android Studio are you using? And how do you launch the AVD Manager?

Panos
--

Tom Bodine

Clicking the greyed Test icon does nothing. I have Android Studio 2.3.3. I launch my AVD from Studio using menu Tools > Android > AVD Manager. Then I launch my virtual device by clicking the green arrow under Actions.

Panos Merakos

Hi Tom,

I have exactly the same setup and it works as expected for me. I suggest you file a bug report at quality.livecode.com so as we can investigate this issue further.

Best,
Panos
--

Tom Bodine

Panos,
Are you using the 64-bit version of Android SDK or x86? Mine is the 64-bit. Wonder if that could be the issue.
Tom

Pablo Miranda

I follow all steps to install LC 8.1.5 and Android Studio. When i make a simple App for android, a button and 'hello world' i can't install it on a Xperia Z2. Always appear the message 'Analysis Error: An error occurred while parsing the package ' (Original message: 'Error de Analisis' 'Se ha producido un error al analizar el paquete')... Someone know where is the problem??

If do you want i can send you the project by e-mail!!

Thnak you!!!!

Elanor Buchanan

Hi Pablo

Firstly check your Android Standalone Settings and ensure you have the Identifier and Minimum Android Version set.

You may also need to enable USB debugging on your device.

I hope that helps.

Elanor

Elanor Buchanan

Just following up with another thought. If you are building a standalone and then copying it to your device you need to choose "Sign for development only" in the Signing section of the Android Standalone Settings. Alternatively, to test directly, you can connect your device, choose it from the Test Target in the Development menu and then use the Test button on the Menubar to test on your device.

Tom Johnson

Could someone please verify this lesson? I'm running LC 8.1.6 and Studio 2.3.3
I'm pretty sure I've followed the lesson correctly. The problem is I consistently get the error: could not encode class bundle. I get this when sending to the VM or building a standalone. I pretty sure I'm not the only one having this happen.

Thanks,
Tom

Elanor Buchanan

Hi Tom, I have run through the lesson here and can successfully build for Android.

Have you installed the Android 4.0.3 package? Could you let us know what OS you are on and what version of the JDK you have installed so we can double check. I am on Mac and have JDK 1.8 installed which works.

Thanks

Elanor

Tom Johnson

Hi Elenor,
Thanks for the reply. I have installed 4.0.3. and 2.2
I’m on a Mac running OS 10.12.6 with LC 8.1.6 stable
Android Studio 2.3.3

Java 1.8.0_144 is installed on my machine.
However, when I look at Preferences > Mobile Support it has 1.7.0_65 shown in the JDK Path. Is that installed by Studio?

Thanks,
Tom

Tom Johnson

Hi Elanor,
The problem I was having was that there was a previous Java folder in the Library folder and even though I have admin on my machine, the Java 8 144 install wasn't added to the existing folder. I renamed the existing folder and re-installed Java 8 144 and it build a new folder with the correct Java level in it. That fixed the Java problem. I don't get "could not encode class bundle" anymore.

I am getting another error however. Could you please explain how you have your Android VM configured.

Thanks,
Tom

Elanor Buchanan

Hi Tom, glad to hear you got that part sorted at least. What error are you experiencing now?

Kind regards

Elanor

Tom Johnson

Hi Elanor. When sending to the VM.
[INSTALL FAILED_NO_MATCHING-ABIS: Failed to extract native libraries, res=-113]
Here's a link to the discussion.
http://forums.livecode.com/viewtopic.php?f=53&t=29660

Thanks,
Tom

Elanor Buchanan

Hi Tom

This error is caused by an incompatibility in the architectures. I've tested 2 emulators here and the one with an x86 CPU/ABI doesn't work but the one with an arm64 CPU/ABI does.

Can you try setting up an arm64 emulator and see if that works?

Kind regards

Elanor

Tom Johnson

Hi Elanor,
Yes, the arm64 works but as I'm sure you know, it's agonizingly slow. So is this something LC needs to fix?

Regards,
Tom

Elanor Buchanan

Hi Tom

I've spoken to our Development Team and they confirm that we don’t currently support 64-bit ARM on Android, nor x86 (32 or 64-bit). The Android engine is armv6 only at the moment so this isn't a bug, it is expected.

You would probably find it much faster to connect up your Android device and test directly on that using the Development menu Test options. That's what we do here in the office as it's much faster than using Android emulators. You'll need to enable USB Debugging mode on your device.

I hope that helps.

Kind regards

Elanor

Craig P Wells

Hi Elanor,
I have encountered inability to get an app working on the latest Androids so I now understand that it is the 64Bit ARM issue (Galaxy S8) - it installs but just show a BSOD - black screen of death. WHEN will 64bit ARM support become available? Soon hopefully.

Craig

Heather Laine

I understand we are working on more and better compatibility with Android simulators, and yes, it should be soon.

Jim Burcicki

Hello,
In setting up the Android SDK, I have pointed to the SDK folder. However, the JDK: Path (none) remains the same. How do I get it to point to the JDK Path?

Elanor Buchanan

Hi Jim,

What version of Java do you have installed? If you are on Windows you will need to use Java 8 as LiveCode is not currently compatible with Java 9 or 10. If you are on Windows could you try downloading and installing Java 8. If that is not the issue please let us know, along with your OS and the version and edition of LiveCode you are using and we will look into it.

Kind regards

Elanor

Yasha

Hi Elanor

In regards to your answer to Jim that Java 9 or 10 is not compatible. If I have already Java 10 installed, do I need to uninstall it? How do I do it? After I install Java 8, do I need to reinstall the Android 4.0.3 package on Android Studio. I'm using a post 8.1.6 version of live code.

Thanks in advance
Yasha

Elanor Buchanan

Hi Yasha, yes, at the moment LiveCode will choose the most recent version of Java to use, do if you have Java 10 installed it will try to use that.

Depending on the version of Windows you have the uninstall steps differ slightly but this article explains how to do it.

https://www.java.com/en/download/help/uninstall_java.xml

I don't think you should have to reinstall the Android 4.0.3 package but you can check it is still installed by opening up the SDK manager in Android Studio and checking that it is ticked.

I hope that helps.

Kind regards

Elanor

John Iglar

I am having the same problem that Tom Johnson was having a year ago.
[INSTALL FAILED_NO_MATCHING-ABIS: Failed to extract native libraries, res=-113]
Is there support for all Android devices now? I'm using LC 9.0 My app saves as standalone and I've put it in the Play store for testing. My tester with Galaxy S8 (Android 8) says it can't install on his phone.

John Iglar

It seems that any Android developers will need a physical device to test their apps. There seems to be no non-x86 images available for Android Studio's emulator for Android 8. Play store requires 8.
(My tester got his version wrong. He was running 7, so couldn't install. Another tester with 8 installed OK.)

Elanor Buchanan

Hi John Iglar

We have been working on adding Android architectures and support will be included in 9.1.0 DP-1. I'm afraid I can't give you a timescale for the release of 9.1.0 DP-1 but you can add your email address to the CC list for the bug report to receive updates when the status of the bug is changed.

https://quality.livecode.com/show_bug.cgi?id=20954

Kind regards

Elanor

Sphere

That is really good news, did not see it before. Thanks Elanor.
Kind regards.

Acch

Hello! I am trying to use the LiveCode v9.0.1 on my windows 10 system. I could not build my application into my android device even though I have followed this forum closely : https://forums.livecode.com/viewtopic.php?t=31288
The error I got was "Unable to build app for testing: apk preparation failedUsage: java"
The Java version I have is "jdk1.8.0_181" I have cleared the excess files in the Java folder and I could not figure out this issue. I did not encounter such issues on v8.1.3 before. I was able to build it on that version. I really hope I can build it into my android device.
Thanks

Elanor Buchanan

Hi Acch

From LiveCode 9.0.1, you also need to have Android 8.0 (API 26) installed. You can install this using the SDK Manager as described above.

If you already have Android 8.0 installed and you still cannot build please let us know and we will look into the issue further.

Kind regards

Elanor

Rhianna

I have a problem with LiveCode finding the valid Android SDK root. I followed the directions and have the avdmanager and sdkmanager in the my_sdk folder that also has the tools folder. I also have run them and it created a file called knownPackages in that folder. When I try to point LiveCode to the SDK root, it also says I don't have Android 8.0, but Android Studio (through the SDK manager) says I do have it. Am I missing a step? Anything will help!

Elanor Buchanan

Hi Rhianna,

What version of Java do you have installed? You need to download and install Java SDK version 8, if you already have Java 9 or 10 installed you will need to uninstall these and reinstall Java 8.

If that is not the issue please let us know, along with your OS and the version of LiveCode you are using.

Kind regards

Elanor

Tony Santa Cruz

I am currently using a Macintosh OS X 10.3.6 and using LiveCode Community 9.5.1 (rc 1) to and trying to create a standalone application for Android.

I have selected the includes and all. Have made sure I have the preferences pointing to the correct Library file for the Android SDK (similar to the example in the article). Made sure all the proper files are installed for the Android SDK.

Livecode just gets stuck on Checking directories in the Standalone Builder Progress and never proceeds beyond that.

Have been trying for days and getting nowhere.

Elanor Buchanan

Hi Tony

I have just tried a very simple Android app here with the same setup and it built ok. Can I ask if you could build Android apps in 9.5.0 and this is a recent issue that affects 9.5.1? Also what inclusions do you have selected? Perhaps one of the inclusions is causing the issue, could you try with a very simple stack and see if you can build that successfully?

Thank you.

Kind regards

Elanor

Tony Santa Cruz

Hello Elanor,

Thanks for the response.

I did as you instructed and used a tutorial stack that I downloaded and was able to get it to convert to a standalone application for Mac and Windows without any issue. However, when I try to get it to convert to a standalone for Android, it gets to Attaching Engine and just I get no response afterwards. It never finishes. This is using LiveCode Community 9.5.1 (rc 1).app.

I have not been able to get an Android standalone app created since a 4.0 version of LiveCode. I have earlier versions and really need to get the latest version working as it has PDF reading capabilities that I really need for my App.

Atleast it doesn't get stuck on the inclusions part with the tutorial stack.

Panos Merakos

Hello Tony,

Could you post a screenshot (so as we can see the contents) of the folder that is is chosen as the android sdk root folder? Also could you post a screenshot of your Preferences -> Mobile Support?

It sounds like something is incorrect in your setup.

Kind regards,
Panos
--

Jana

I'm struggling to compile for Android on Ubuntu 18.04 LTS. I can compile on a Windows machine, so I'm looking for pointers. I'm using LC 9.5. Under Preferences > Mobile Support the Android SDK is correctly entered, and the JDK points to /usr/lib/jvm/java-8-oracle which I understand to be correct. However, when I try to compile, I get stuck when 'building classes' and get a 'could not compile service support class' error. I have re-installed Java, Android Studio, and LiveCode to no avail.

Elanor Buchanan

Hi Jana

What is your application identifier set to in the Android Standalone Application Settings? If it is not correctly formatted the service support class will fail to compile.

The rules are
- It must have at least two segments (one or more dots).
- Each segment must start with a letter.
- All characters must be alphanumeric or an underscore [a-zA-Z0-9_].

If that is not the issue please let us know.

Kind regards

Elanor

Jana

Dear Elanor. Thanks for the fast response! The application identifier in the Android Standalone Application Settings is the common "com.jana.app" style, thus not a problem. I can compile the same stacks on the Windows machine that seems to be setup the same way. I get the same error if I create a new stack, too.

Elanor Buchanan

Hi Jana

Sorry for the delay in getting back to you. This error might be occurring because of the version of Java you are using. We have tested and the openjdk version of Java works for us here, could you try this instead of the Oracle version. An example of the jdk path that works for us is

/usr/lib/jvm/java-1.8.0-openjdk-arm64

I hope that helps.

Kind regards

Elanor

matins

Unable to install SDK. It keeps bringing me to this site where I have to either sign in to and a account or make an account... I clicked make an account and had to enter my name, postcode, job, business line, phone line, which am to young for.

Heather Laine

You can download Android Studio without providing any personal information. I expect you do need to provide more information to create an Apple Developer or Google Play account. Perhaps you can get an adult to do this for you?

NN

Panos forgot to add: For all "first time users" who want or have to start with Android Studio > 3.1 and LC > 9.5 , they have to install also the included sub-packages ref to each SDK (eg Pie) + Legacy support as explained by Panos in this DOC... otherwise some parts the Android SDK/API will be missing and the LC IDE will recognise neither the Android SDK nor the Java JDK! SO in Android Studio (start screen) go to configure > Android SDK > select the Version and activate "Show Package Details" !!! - just select all for each Version (I didn't wanna waste my time with finding out what part is missing - so in the interest of time I picked them all). Just a friendly reminder to the LC MGMT - if you advertise your product as truly X-platform - you must get your docs right "on time" - you must not say - oh Apple did something with Xcode in the new version where we struggle with same for Oracle Java and Android... I truly understand you can't pick all battles with 3rd party interfaces BUT you must share the details with your clients !!! !!! !!! in a timely manner !!! !!! !!!

Heather Laine

In the lesson, we say:

The Android SDK Manager lets you select the packages you would like to install in your Android development environment. By default, only a few packages are selected. Select the required package for your version of LiveCode. You can have other packages installed too, these are just the required packages:

LiveCode 9.0.1: Android 4.0.3 (IceCream Sandwich) - API 15
LiveCode 9.0.1 - LiveCode 9.0.5: Android 8.0 (Oreo) - API 26
LiveCode 9.5.0+: Android 9.0 (Pie) - API 28

These are the required packages of the Platform Tools that are needed for building an Android standalone. So if you are in LC 9.6 DP-4, you will only need the Android 9.0 (Pie) - API 28 platform tools from this tab. What you suggest, i.e. to:

"activate "Show Package Details" - just select all for each Version"

will install all the possible versions of the android system images, which means all the possible versions (and architectures) for the Android simulators. This is clearly not necessary, and apart from that, the "system images" packages need several GBs to be saved. It is better to select the individual package that is required.

yahli zvyfler

i download the virtual devices and it works but i dont see him on the test target i have android studio 3.6 and community 9.5

yahli

hey
i don"t see the option to "android sdk tools (obsolete)" and i Uncheck the hide obsolete packages.
and i cant see the sdk in the /Users/youruser/Library/Android/sdk/ i dont have Library in the android studio i see that in a AppData and i dont have a folder that called app data
thank for helping

Heather Laine

If you are on Windows, then you will have your SDK in AppData. You need to make this folder visible by choosing "show hidden folders". Then you should be able to select it from LiveCode.

Heather Laine

your virtual device should appear in test target once you have set the path in LiveCode to your Android SDK.

Heather Laine

Make sure you have also checked at least one arch for in the LiveCode Standalone settings for Android so that building for Android is enabled.

Kim

My computer died a few days ago and I needed to do a factory reset & re-install LC. FYI:
- The lesson is correct, except that, with Android Studio 3.6.3, it is "Tools menu" not "Configure menu"
- Also, Android Studio forced me to create an SDK folder, and was very pedantic about where I could create it and how I could name it
- upon install Android Studio gave me a bunch of error messages about "Gradle". No idea what this is, but I managed to successfully deploy a standalone onto an Android device so I'm guessing that it doesn't matter for LC purposes

Thanks for the lesson

Peter

Hi ,
new to livecode , as experienced programmer.
- windows install :
ok, but ide is soooooooooooooooooooooooooooooooooooooooooooooooooooooo
slow.....
- the ide windows are horribly place and jump all over the place
- icons are hardly readable , what gives, are we still in 1990 or 2020 ???
ok , then trying the linux distro
- cannot install for all users , if installing for 1 users, getting error when trying to open dict. window
- ide , poor , same as windows

- it seems the people that are "really" using it , are using macos

- this is not a new product , and still a pain to install ,and an ide that sucks in windows and linux

- do you really want to increase your user base or what ????

regards,

Peter

Mark Wieder

Peter, not a Windows user, so I can't comment on that part.
On linux, installing for all users will install into /opt, so you need permissions to do that. I don't have those problems with the IDE - it's responsive and the dictionary opens in a web browser. If you're installing an older build then it may be trying to use a CEF browser to open the dictionary, which will indeed result in an error.
Are you installing the latest build?

Matthias Rebbe

Peter, there were reports from users who had similar performance problems under windows with Microsoft Defender active? Is it possible by any chance that you are using Defender as your security software? If so, you could try to exclude Livecode .exe file and the my livecode folder from realtime scanning in Defender.

Pradeep Saxena

I have 9.5.1 LC indy, MacOS High Sierra (10.13.6) and using MapKit for iOS & Android. Got the google Map sdk API working on the Android simulator. The MapWidget works fine with the markers etc. on the Android/iOS emulators and MacOS. The generated apk installs on Samsung G8 but crashes on the MapWidget screen. The app identifier is updated and also the app is signed with a keystore file. The google map API is working for the widget to work on the Android Emulator. What am I missing to make it work on the Android phone? Same issue using LC 9.6

Elanor Buchanan

Hi

Have you added your Google Maps API key in the Inclusions pane of the Standalone Application Settings? In the General Pane choose "Select inclusions for the standalone application, in the Inclusions pane tick the Map widget and click on the cogs to add your API key. You will also need to make sure any other inclusions you are using are ticked.

I hope that helps, if that is not the solution please let us know.

Kind regards

Elanor

Pradeep Saxena

Hi Heather,
I did add the Google Map API key and that's the reason why it works on Android Simulator (without the right API key, it does not work in Android Simulator). The fastest way to resolve this would be to send me a basic working livecode script with map widget for Android device and I can use my GoogleMapAPI key to validate it on an Android device.

Thanks,
Pradeep

Elanor Buchanan

Hi Pradeep

You can download my test stack from this link, you will need to add your API key.

https://downloads.livecode.com/learning/techsupport/MapTest.livecode.zip

I testing on an Android phone running 7.1.1 and I tested with both signed and unsigned apps. What version of Android is your test device running?

Kind regards

Elanor

Pradeep Saxena

Hi Elanor,
Thanks for providing the test stack. Though, it did not help resolve the issue, but I think I discovered understanding couple of other issues: 1. Your stack did not work in my environment as is. It kept crashing on Android simulator and Android phone (9.0). Surprisingly, when I created an identical new stack in my LC indy 9.5.1 with the same map api key, it worked on the Android simulator, but not on device!! This helped me discover the reason why my working map widget stacks in LC business on simulator stopped working on LC indy (though identical LC version 9.5.1), all because of the map widget issue. Once I recreated the fresh map widget stack and copied the code, it started working on the Android Simulator! 2. The MapWidget bug reported on April 14,2019 still persist (https://forums.livecode.com/viewtopic.php?f=104&t=32479) as the Visible property toggle of MapWidget crashes the app in the simulator! Perhaps the map widget may work on my android device while generating the apk on windows/linux desktop (will try and let you know). Please provide answers to following:
1. What is your environment? Desktop OS & LC version for the provided Test Script.
2. What is the possible reason that your test stack did not work as it is, but worked as expected in the simulator only when I recreated it in my environment with the same map API
3. I am using the Google Map Android SDK api (There are 15 different Google Map APIs), Is this the correct one? If not which is the correct one, but then why should the widget work in simulator using this API?
4. My app release is delayed only because of the MapWidget issue in Android device. Please help resolve this at your earliest.

Thanks for all the help in advance,

Pradeep

Elanor Buchanan

Hi Pradeep

I have uploaded a new version of the test stack to

https://downloads.livecode.com/learning/techsupport/MapTest2.livecode.zip

There was some information left in the stack connecting it to my API key which I have removed. This is why my stack did not work on your environment but a recreation did.

We have also found an issue with the Map widget on Android 9 devices, which we think is why it is working in the simulator but not your device.

https://quality.livecode.com/show_bug.cgi?id=22784

You can work around this by adding the required key to the manifest template in

/Applications/LiveCode Business 9.6.0.app/Contents/Tools/Runtime/Android/Manifest.xml

Add

just before the closing tag:

I hope that helps.

Kind regards

Elanor

Roger Mepham

Success first time! Followed instructions above and am now seeing an Android app running on the emulator.
Notes:
1. Running on MacBook Catalina 10.15.6 with Livecode 9.6.1
2. Installed Java 8 first
3. Installed Android studio using "Recommended options" in installer, note that Android SDK Tools (Obsolete) was already ticked and installed so no need to configure.
4. Selected API 29 Android 10 (not the latest 10+ which I had to change)
5. Livecode accepted the path to the Android tools in preferences
6. In Android studio started an empty project and configured a Pixel 3 virtual device and started it.
7. Opened a new Livecode iPhone 6 project size and configured the standalone as Android with a "Sign for development only" choice
8. Selected Android emulator as the target for testing in Livecode

Built and run first time - woohoo!

Add your comment

E-Mail me when someone replies to this comment