metaeducation / rebol-server

Packs Android-native-Rebol with a WASM-Rebol Web Console into an .APK
GNU Lesser General Public License v3.0
7 stars 4 forks source link

"This app was built for an older version of Android" #3

Closed hostilefork closed 4 years ago

hostilefork commented 5 years ago

When I finish the .APK build process and run the Rebol Server, it installs...but the first time it launches it says:

This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.

The phone is a moto g(6) play. It says it has Android version 9. The Build number is PPP29.118-17-1.

It seems to work okay, but I don't know anything about Android versioning... :-/ Is there any way we can use some lowest common denominator of features and declare "it's fine for version 9"?

giuliolunati commented 5 years ago

Sure! in AndroidManifest.xml set targetSdkVersion=28

See https://developer.android.com/guide/topics/manifest/uses-sdk-element

hostilefork commented 5 years ago

Sure! in AndroidManifest.xml set targetSdkVersion=28

Hmmm...I guess there is no way to build one version of the .APK that can be loaded on both version 9 and before without this warning? It seems like the Google Play store makes multiple .APK and then gives you the right one:

https://stackoverflow.com/questions/9756808/can-one-android-app-have-different-versions-for-different-devices-at-the-same-ti

If we can't make a "Universal .APK" file, then I think when you build on a phone, the process should probably default to picking the right SDK version for your phone. How can a bash script detect the version to change the manifest? I see some suggestions that say you should run adb but that isn't running by default in Termux:

https://stackoverflow.com/questions/8063461/getting-android-sdk-version-of-a-device-from-command-line

However, if you run the dumpsys command in Termux, there are several properties in there for ro.build.xxx, including (on my phone): [ro.build.thumbprint]: [9/PPP29.118-17-1/cfed4:user/release-keys]. So the 9 can be picked out of there, I think? I don't know if this is the best way, or if the output of dumpsys has stayed consistent in this way on older Androids. Perhaps there's a better way--it could be another StackOverflow question about "how to do without adb if that's not working" (you may know why that works for them and not me).

When building on Linux, it might not need a default, but have you supply a version. Then the Travis script would just make as many .APK as we decided were necessary, by calling the build.bash multiple times. I would say we would only add versions on demand if someone needed it; there is no need to add older ones no one wants:

https://fossbytes.com/most-popular-android-versions-always-updated/

We would also presumably want the likes of rebol-server-9.apk and rebol-server-9-debug.apk (?) I don't know. It seems a bit of a pain to have to install separate .apk files for that; maybe it's even better to be able to have a toggle in the server UI to switch between debug and release in the same app?

giuliolunati commented 5 years ago

"Hmmm...I guess there is no way to build one version of the .APK that can be loaded on both version 9 and before without this warning? It seems like the Google Play store makes multiple .APK and then gives you the right one"

targetSdkVersion=nn works well for ALL mm <= nn, so np to set nn=28

giuliolunati commented 5 years ago

just tried it, works fine with Android 7.0

giuliolunati commented 5 years ago

Fixed in 883c6c9

hostilefork commented 5 years ago

just tried it, works fine with Android 7.0

I'm still getting the same message (Just to be sure, I uninstalled the app...did rm bin/*, did a git pull, confirmed with git log I was up to date with the change, ran bash build.bash, and tried reinstalling.)

Still runs, but same message...

giuliolunati commented 4 years ago

I hope solved in f6b29fe