Skip to content
Draft
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ If you encounter build errors related to Android SDK or aapt2, try the following
npx react-native run-android
```

**Note:** This project uses Android API level 34 and Kotlin 1.8.22. Make sure you have the Android SDK Platform 34 installed in your Android SDK Manager.
**Note:** This project uses Android API level 35 and Kotlin 1.9.0. Make sure you have the Android SDK Platform 35 installed in your Android SDK Manager.

**Important:** Android API level 35 has known aapt2 resource table parsing bugs that cause build failures. Please use API level 34 instead.
**Important:** This project uses Android Gradle Plugin 8.1.4 and Gradle 8.2 to properly support API level 35 and comply with Google Play requirements for 16KB page size support.

### Kotlin Dexing Errors (D8/R8 failures)

If you encounter errors related to Kotlin dexing (e.g., `Error while dexing`, `com.android.tools.r8.kotlin`), this is usually due to Kotlin version incompatibility. The project uses:
- Android Gradle Plugin 7.4.2
- Kotlin 1.8.22
- Android Gradle Plugin 8.1.4
- Gradle 8.2
- Kotlin 1.9.0
- React Native 0.68.2
- Android API level 34
- Android API level 35

These versions are tested and compatible. After pulling updates, clean your gradle cache as described above.

Expand Down
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ dependencies {
exclude group:'com.facebook.flipper'
}

// Force patched version of assertj-core to fix XXE vulnerability (test scope only)
// Force patched version of assertj-core to fix XXE vulnerability
// Vulnerable: 1.4.0 - 3.27.6, Patched: 3.27.7
// Explicitly declare for test scopes (also forced globally in root build.gradle)
testImplementation 'org.assertj:assertj-core:3.27.7'
androidTestImplementation 'org.assertj:assertj-core:3.27.7'

Expand Down
7 changes: 6 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:enableOnBackInvokedCallback="true">

<!-- Support for 16KB page sizes (required for Android 15+) -->
<!-- Declared with targetSdkVersion 35 to comply with Google Play requirements -->
<property android:name="android.build.optimization.16kPageSize" android:value="true"/>

<activity
android:name="com.rn.MainActivity"
Expand Down
13 changes: 9 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
kotlin_version = '1.8.22'
// Using API 35 to comply with Google Play requirements
// Upgraded to AGP 8.1.4 to properly support API 35 and fix aapt2 issues
compileSdkVersion = 35
targetSdkVersion = 35
kotlin_version = '1.9.0'

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand All @@ -23,7 +25,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.4.2')
classpath('com.android.tools.build:gradle:8.1.4')
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.6.0")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down Expand Up @@ -54,6 +56,9 @@ allprojects {
}

// Force patched version of assertj-core to fix XXE vulnerability
// Vulnerable versions: 1.4.0 - 3.27.6 (including 3.21.0)
// Patched version: 3.27.7
// This forces ALL transitive dependencies to use the safe version
configurations.all {
resolutionStrategy {
force 'org.assertj:assertj-core:3.27.7'
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Aug 28 17:07:30 ART 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists