New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating build scripts for Android #431

Closed
ivan-mogilko opened this Issue Feb 16, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@ivan-mogilko
Member

ivan-mogilko commented Feb 16, 2018

Since we need to begin fixing #420, me and @ericoporto were researching how AGS Android port is built (in the abscence of more experienced devs who maintained Android port earlier).

@ericoporto made a pull request #430 with the changes he found made him compile native libraries necessary to build the engine itself, which I asked him to do, but apparently I were too hasty, because these changes may change too much (then again, maybe not).

I think we better discuss what we've found properly, and clarify the issues first.

To begin with -

1) Android/README.md mentions that one does not have to rebuild 3rd party natives libs unless their source had to be modified. This was relevant in the past when our repository had prebuilt libraries kept there, which is no longer the case, since @sonneveld modified building process. Now this step is obligatory, and Readme must be fixed to reflect that.

2) What we've found is that the build scripts were assuming android-9 the lowest supported platform.
However, the newest NDKs dropped support for anything below android-14.

For the reference:
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
https://en.wikipedia.org/wiki/Android_version_history

Android-9 API is released in 2010, Android-14 is of 2011. But I have absolutely no idea about numbers of old devices still in use.

Couple of related discussions I found:
https://groups.google.com/forum/#!topic/android-ndk/qqRVhXwSN4Y
https://stackoverflow.com/questions/45685227/android-ndk-support-version-limited

Now our options here are:
A) Change minimal support to Android-14. (And probably align device support along with NDK devs in the future). If someone would need a port for very old device, they would have to modify scripts and build for themselves).
B) Keep supporting Android-9, which means we will have to use an older NDK (ndk r14, I think). But this introduces a chance that it won't work optimally on newest devices.
C) Make a pair of scripts, one building APK for older devices (API 9-13) and one for the ones newest NDK support (14+).

Option A) seem simpliest, so unless these older devices are still widely used (idk if it's hard to upgrade system on them?), this may be our way to go.

3) Referencing the NDK location in scripts. Currently is hardcoded as

/opt/android-ndk-r10e-standalone/
. And this path is used in multiple scripts, as seen in file changes for #430.
Obviously, every user may have NDK installed in different locations, e.g. in Home. What would be an optimal way to deal with this? Maybe require to pass NDK path as an argument to these scripts? May there be some enviroment variable that points to NDK?
If not, then we'd need to mention in README that users need to edit scripts if their NDK is somewhere else.
Another thing, would that be possible to only define this path in one, starting script (i.e. makestandalones.sh) and pass it as an argument to the rest?

@jdiperla

This comment has been minimized.

Show comment
Hide comment
@jdiperla

jdiperla Feb 16, 2018

jdiperla commented Feb 16, 2018

@ivan-mogilko

This comment has been minimized.

Show comment
Hide comment
@ivan-mogilko

ivan-mogilko Feb 16, 2018

Member

I think it’s safe to say you can drop anything below android 14. Android
Ndk api 14 is version 4(ice cream sandwich) which is currently found on
0.4% of all android devices as it is.

That's good to know!

Meanwhile I found the statistics page on android dev's website, which is super useful and actually confirms this info and answers some other questions I had:
https://developer.android.com/about/dashboards/index.html

Member

ivan-mogilko commented Feb 16, 2018

I think it’s safe to say you can drop anything below android 14. Android
Ndk api 14 is version 4(ice cream sandwich) which is currently found on
0.4% of all android devices as it is.

That's good to know!

Meanwhile I found the statistics page on android dev's website, which is super useful and actually confirms this info and answers some other questions I had:
https://developer.android.com/about/dashboards/index.html

@jdiperla

This comment has been minimized.

Show comment
Hide comment
@jdiperla

jdiperla Feb 16, 2018

jdiperla commented Feb 16, 2018

@ivan-mogilko

This comment has been minimized.

Show comment
Hide comment
@ivan-mogilko

ivan-mogilko Feb 19, 2018

Member

Fixed by #430.

Member

ivan-mogilko commented Feb 19, 2018

Fixed by #430.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment