Page 1 of 1

Min Android API vs target Android API in Google Play

Posted: Sat May 19, 2018 4:35 pm
by davidchang
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

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

Posted: Sun May 20, 2018 12:47 am
by bangkok
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

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

Posted: Sun May 20, 2018 5:04 pm
by davidchang
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.

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

Posted: Sun May 20, 2018 9:45 pm
by livecodeali
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

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

Posted: Mon May 21, 2018 3:48 am
by davidchang
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

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

Posted: Mon Jun 18, 2018 7:33 pm
by PeterS
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.