Min Android API vs target Android API in Google Play

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

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
davidchang
Posts: 20
Joined: Wed Jul 08, 2015 12:14 am

Min Android API vs target Android API in Google Play

Post by davidchang » Sat May 19, 2018 4:35 pm

Hi,

When compiling my Android app in Livecode I set the minimum Android version to 4.0 (API 14). However, when trying to import to Google Play, which is an update to an existing app, I get an error message that it need to target at least Android version 8.0 (API 26) under Googles new rules. The only way I can seem to load on to Goolge Play is by compiling in Livecode with a minimum Android version of 8.0. But when doing so my device running 4.0 would not side load the APK with a error message that it could not parse the package. So my question is how can I target 8.0 but still have a minimum of 4.0? Because this is an update to an existing app I'm concerned setting the minimum to 8.0 will cause problems for all the existing users running lower OS if they update.

Thanks,
David

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 790
Joined: Fri Aug 15, 2008 7:15 am

Re: Min Android API vs target Android API in Google Play

Post by bangkok » Sun May 20, 2018 12:47 am

The Livecode mailinglist has a thread that might answer your question (explanation and a kind of patch to solve the issue) :

http://lists.runrev.com/pipermail/use-l ... 47201.html

davidchang
Posts: 20
Joined: Wed Jul 08, 2015 12:14 am

Re: Min Android API vs target Android API in Google Play

Post by davidchang » Sun May 20, 2018 5:04 pm

Thanks, however it doesn't seem to work as it still recognizes the target as the minimum. Maybe I'm doing something wrong, I am on LC9 by the way. Is there a way to just alter the actual LC manifest.xml rather than merge them on compile as suggested? A summary from the mailinglist thread...
the target version is already included in the Android manifest that LC uses by default. It is set to be the same as the minimum version. We can edit that to use a different number. Make a copy of the default manifest, located at: <Your LC app>/Contents/Tools/Runtime/Android/Manifest.xml

Change this: <uses-sdk android:minSdkVersion="${MIN_SDK_VERSION}" android:targetSdkVersion="${MIN_SDK_VERSION}"/>

To this:<uses-sdk android:minSdkVersion="${MIN_SDK_VERSION}" android:targetSdkVersion=26/>

Then include the revised manifest in the Copy Files pane of the standalone settings. In LC versions prior to LC 9 it will replace the default one when you do a build. In LC 9, the standalone builder now merges your manifest with the default template.

livecodeali
Livecode Staff Member
Livecode Staff Member
Posts: 160
Joined: Thu Apr 18, 2013 2:48 pm

Re: Min Android API vs target Android API in Google Play

Post by livecodeali » Sun May 20, 2018 9:45 pm

Yes, you could change the template manifest - it's at LiveCode Community 9.0.0.app/Contents/Tools/Runtime/Android/Manifest.xml for example on Mac

davidchang
Posts: 20
Joined: Wed Jul 08, 2015 12:14 am

Re: Min Android API vs target Android API in Google Play

Post by davidchang » Mon May 21, 2018 3:48 am

Thanks, figured that out this afternoon. Had to run notepad++ in admin then open the Manifest.xml to make the edit. Note that I needed quotes around the target version number...

This:<uses-sdk android:minSdkVersion="${MIN_SDK_VERSION}" android:targetSdkVersion="26"/>
Not this:<uses-sdk android:minSdkVersion="${MIN_SDK_VERSION}" android:targetSdkVersion=26/>

Seems to be working now, loaded to Google Play and the download looks good too. Since Google Play will require the target version to change overtime i'll have to keep editing this file, unless LC inserts a target version drop down field as a future update.

Thanks again for the help,
David

PeterS
Posts: 5
Joined: Wed Sep 16, 2015 3:00 pm

Re: Min Android API vs target Android API in Google Play

Post by PeterS » Mon Jun 18, 2018 7:33 pm

If you change it to 26 you can upload it to google play, but remember that push notifications does not work than any more. I think it a bug.

Post Reply

Return to “Android Deployment”