-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to Android minSdkVersion 19 and targetSdkVersion 34
This is updated to meet the latest requirements for apps on the Google Play store
- Loading branch information
Showing
5 changed files
with
19 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Nov 11 18:20:34 PST 2021 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to change the minSdkVersion? I managed to targetSdkVersion 33 so far and keep minSdkVersion 16.
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the math.h error when trying to do that... ?
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me dig deeper and attempt to target 34 again - I had some problems, but not relating to math.h.
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slouken I can confirm that I can target 34 and retain min 16. No problems at all. Slightly different build config to android-project though. Would you like me to come up with a working android-project that keeps min 16? I'm using a lot of extra stuff in project gradle.properties such as "android.useAndroidX=true" and full R8 optimization with progaurd, so I'm not sure if that is coming into play 🤷🏼♂️
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Is there a simple solution for the math.h compile error? Did you run into that and solve it somehow?
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got no math.h compile error when changing the target to 34 and updating the Gradle version. I do vaguely remember a problem with math.h 1-2 years ago which had something to do with a buggy version of NDK. Android Studio seems to resolve problems after a clean and a refresh of the SDK manager.
Let me experiment some more and see if I can re-create the math.h issue with android-project and bisect what fixes it. I'm pretty sure we can keep the old minSdkVersion without doing anything complicated.
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slouken I can confirm 100% we can still have
minSdkVersion 16
. I took the android-project and just changedminSdkVersion 19
tominSdkVersion 16
and it works. I tried as hard as I could to reproduce any kind of compiler error and couldn't.I have a feeling it's because of a redundant / depreciated tool that needs to be "unticked" in the SDK manager, or something needs to be cleaned. Untick all platforms and tools in SDK manager (make sure you don't hide obsolete packages). Clean Project. Refresh Linked C++ Projects. Delete ".gradle" & "build" directories. Let synch & build download the required platforms & tools. Builds no problem in Android Studio Giraffe | 2022.3.1 Patch 1.
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you building for 32-bit arm?
I'm using the latest NDK toolchain, and this is the error I'm getting:
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can build for all the ABIs: 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'.
My build chooses 25.1.8937393, for some reason, so I added
ndkVersion "25.2.9519653"
and it still works. I was sure that math.h errors I had in the past were due to a bug in a specific NDK version.There's clearly a difference between our builds, even though I created a fresh project from android-project. I don't think I'm touching cmake, if that means anything? Aren't there two different compiler options in Android? Maybe cmake chooses the other one? It could be something specific to the cmake settings, but I don't know anything about it - I just build from Android Studio's menus.
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My build also chooses 25.1.8937393, I just forced the latest NDK just to make sure I wasn't missing anything. I'm not using cmake, just ndk-build from gradle.
Are you building hidapi/android/hid.cpp, with HIDAPI enabled?
1e9d314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dumb-checked hid.cpp is enabled by entering gibberish in hid_init() and it failed at my gibberish. I can build debug and non-debug apk and aab of all 4 ABIs. Latest SDL source and android-project out of the box just works with min 16. FWWI, on discourse it looks like others have had it fail and others have also had it build no problem.
Let's not waste more time on this. A jump from 4.1 to 4.4 is not the end of the world. If Google plan on enforcing 4.4 minimum anyway, then it's not worth fighting this. Leave the SDL project at 19 and see if anyone else complains. If anyone can get 16 to work and wants to, then let them, maybe at least put a note in somewhere that 16 might work.