Skip to content

Conversation

@automaton82
Copy link
Collaborator

This pull request updates the Android build environment and codebase for compatibility with the latest SDKs and Google Play Store requirements, while also improving code robustness and maintainability. The most significant changes involve upgrading the Android SDK and Gradle versions, adding support for 16KB page size alignment, and enhancing compiler flag usage to address stricter warnings and errors.

Build system and platform updates:

  • Upgraded compileSdkVersion and targetSdkVersion in app/build.gradle from 34 to 35 to support the latest Android APIs.
  • Updated Gradle wrapper version in gradle/wrapper/gradle-wrapper.properties from 8.2 to 8.9 for improved build tooling and compatibility.

Google Play Store 2025 requirements:

  • Added linker flag -Wl,-z,max-page-size=16384 in multiple build scripts (app/build.gradle, Application.mk, tuxpaint/Android.mk, and for magic modules) to ensure 16KB page size alignment as required by Google Play Store. [1] [2] [3] [4]

Compiler warning and error handling:

  • Expanded use of -Wno-error and related flags in several Android.mk and Application.mk files to suppress new or stricter compiler warnings (such as cast-function-type-strict, int-conversion) and prevent build failures due to treated warnings as errors. [1] [2] [3] [4]

Codebase and dependency improvements:

  • Added new include paths in tuxpaint/Android.mk to support additional modules and libraries, improving modularity and maintainability.
  • Updated sensor event polling in SDL_androidsensor.c to use ALooper_pollOnce instead of ALooper_pollAll for more precise event handling.

Minor code and dependency updates:

  • Updated mouse wheel event handling in tuxpaint.c to use floating point values and the proper SDL wheel event type for improved input accuracy.
  • Added new header includes for SDL and Android integration in i18n.c and tuxpaint.c. [1] [2]

Upgrade Android Gradle Plugin to 8.7.3, update target SDK to 35, add 16KB ELF alignment flags, and fix NDK r27 compilation issues across harfbuzz, SDL, and native libraries to ensure compliance with mandatory Play Store requirements effective November 2025.
@automaton82 automaton82 self-assigned this Sep 14, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request updates the Android build environment to meet Google Play Store 2025 requirements and improve compatibility with the latest Android SDKs. Key changes include upgrading to Android SDK/Gradle versions and implementing 16KB page size alignment support.

Key changes:

  • Upgraded Android SDK from version 34 to 35 and Gradle from 8.2 to 8.9
  • Added 16KB page size alignment linker flags across all build configurations
  • Enhanced compiler warning suppression to handle stricter build requirements

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gradle/wrapper/gradle-wrapper.properties Updates Gradle wrapper from 8.2 to 8.9
app/build.gradle Upgrades Android SDK versions and adds 16KB page alignment
app/src/main/jni/Application.mk Adds global compiler flags and 16KB page alignment
app/src/main/jni/tuxpaint/Android.mk Adds include paths and 16KB page alignment for tuxpaint module
app/src/main/jni/glib-2.77.0/Android.mk Adds compiler warning suppression flags
app/src/main/jni/cairo-1.14.0/Android.mk Adds int-conversion warning suppression
app/src/main/jni/SDL2_ttf/external/harfbuzz/Android.mk Adds extensive compiler warning suppression
app/src/main/jni/tuxpaint/src/tuxpaint.c Updates SDL mouse wheel API calls and adds header include
app/src/main/jni/tuxpaint/src/i18n.c Adds SDL and Android header includes
app/src/main/jni/SDL2/src/sensor/android/SDL_androidsensor.c Changes sensor polling method for better event handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@automaton82
Copy link
Collaborator Author

Hi @perepujal , it appears Google Play is requiring 16kb page size for all apps starting Oct 31.

https://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html

Additionally, they're asking to target minSDK 34 but I bumped to 35 to gain 16kb support. This is a pretty big change as it required a big Gradle update and so the NDK/SDL did as well.

The new NDK/gradle is quite strict so I had to suppress quite a few things. Also, I would call your attention to i18n.c and tuxpaint.c, both of which required changes to make it compile. Without these, we can't publish to Google Play Store anymore after Oct, but I may not have done the changes in the best way (I am not very good with C++).

With these changes, I have it compiling both command line with ./gradlew assembleDebug and with Android Studio itself, Android Studio Narwhal 3 Feature Drop | 2025.1.3. I also have it deploying and working on my Samsung Galaxy phone without issue.

@rubo77
Copy link
Contributor

rubo77 commented Oct 2, 2025

you should also adapt the readme with my changes in #43

especailally the hint

Make sure to set the emulator's preferred ABI to match the build target arm64-v8a

@rubo77
Copy link
Contributor

rubo77 commented Oct 2, 2025

in the emulator on Ubuntu 2024.04 i get this lots of repeated in the log EGL_BAD_ACCESS: context current to another thread! errors when running on arm64-v8a Android emulator. The error eglMakeCurrent(1976): error 0x3002 (EGL_BAD_ACCESS) appears continuously during runtime. (Tested in emulator only, no physical device available)

and the start screen has no funciton. like in #43

This was referenced Oct 2, 2025
@automaton82 automaton82 merged commit 746dc3e into master Oct 26, 2025
1 check passed
@automaton82 automaton82 deleted the feature/16kb-page-size-support branch October 26, 2025 21:19
@automaton82 automaton82 restored the feature/16kb-page-size-support branch October 26, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants