Skip to content

Add 16KB page size support for newer Android devices and rebuild native libraries#753

Open
siddhesh-bhadale wants to merge 1 commit into
jiangdongguo:masterfrom
siddhesh-bhadale:feature/16kb-page-support
Open

Add 16KB page size support for newer Android devices and rebuild native libraries#753
siddhesh-bhadale wants to merge 1 commit into
jiangdongguo:masterfrom
siddhesh-bhadale:feature/16kb-page-support

Conversation

@siddhesh-bhadale

@siddhesh-bhadale siddhesh-bhadale commented Mar 14, 2026

Copy link
Copy Markdown

This PR adds support for devices using a 16KB memory page size, which causes
crashes with the current prebuilt native libraries on newer Android devices.

Key changes:

• Updated Gradle from 6.7.1 → 8.13
• Updated Android SDK and NDK configuration

  • NDK 27
  • SDK 36
  • Kotlin 2.0.21

• Removed prebuilt native .so libraries from jniLibs
• Reconfigured native build using Android NDK (externalNativeBuild)

Native libraries are now compiled from source instead of using older
precompiled binaries.

This allows enabling:

ANDROID_SUPPORT_16K_PAGES=true

which provides compatibility with devices using a 16KB memory page size.

Libraries updated:

  • libuvc
  • libnative
  • libausbc

New AARs generated:

  • libuvc-4.0.0.aar
  • libnative-4.0.0.aar
  • libausbc-4.0.0.aar

Packaging configuration:
packaging.jniLibs.pickFirst is used to prevent duplicate native library conflicts.

Demo App:

The demo app module is temporarily disabled due to compatibility issues
with the updated Gradle and NDK configuration. The core libraries build
successfully and have been tested in a production Android application.

The demo application can be updated separately in a future PR.

Testing:

The updated libraries were tested with USB cameras in a real Android
application and work correctly on devices using a 16KB memory page size.

Tested devices:

• Realme Narzo N55
• Realme Narzo 80x
• Samsung Galaxy S24 Ultra
• Samsung Galaxy A15

Camera preview and USB device connection worked correctly during testing.

This change improves compatibility with newer Android devices while
maintaining support for existing architectures.

Fixes #746
Fixes #745
Fixes #744
Fixes #735

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

Labels

None yet

Projects

None yet

1 participant