Skip to content
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

android: Update targetSdkVersion to 34, i.e., Android 14 #5892

Merged
merged 3 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':ReactAndroid')

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

Expand Down
14 changes: 13 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ buildscript {
// but some testing is required and code changes are often required.
// See upstream for background and more discussion:
// https://medium.com/androiddevelopers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd
targetSdkVersion = 33
targetSdkVersion = 34

// Should be the latest SDK version available. See upstream recommendation:
// https://medium.com/androiddevelopers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd
// What's the latest? Consult this list:
// https://developer.android.com/studio/releases/platforms
compileSdkVersion = 34

// Latest NDK 24, for Apple Silicon compatibility.
ndkVersion = "24.0.8215888"
}
repositories {
google()
Expand Down Expand Up @@ -61,6 +64,15 @@ allprojects {
mavenCentral()
google()
}

configurations.all {
resolutionStrategy {
dependencySubstitution {
// Make our dependencies look at our RN fork built from source.
substitute module("com.facebook.react:react-native:+") with project(":ReactAndroid")
}
}
}
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m
# We allow more space (no MaxMetaspaceSize; bigger -Xmx),
# and don't litter heap dumps if that still proves insufficient.
org.gradle.jvmargs=-Xms256m -Xmx1280m
org.gradle.jvmargs=-Xms256m -Xmx2048m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
16 changes: 16 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
google()
}
}

rootProject.name = 'ZulipMobile'

apply from: '../node_modules/expo/scripts/autolinking.gradle'
Expand All @@ -7,3 +15,11 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n
applyNativeModulesSettingsGradle(settings)

include ':app'

include ':ReactAndroid'
project(':ReactAndroid').projectDir = new File(
rootProject.projectDir, '../node_modules/react-native/ReactAndroid')

// The RN Gradle Plugin is needed to build RN from source.
// (We do that to make some changes to RN, with our zulip/react-native fork.)
includeBuild('../node_modules/react-native/packages/react-native-gradle-plugin')
24 changes: 24 additions & 0 deletions docs/howto/forked-rn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Using a `react-native` with cherry-picked or custom changes

Since 2024-09, we use a fork of `react-native` to make changes
atop 0.68.7. We prefer to avoid upgrading to later `react-native`
releases because it's laborious and we're eager to retire this
codebase and transition to `zulip-flutter`.

When there's an issue in React Native that calls for changes in
React Native:

- Push those changes to our RN fork, `zulip/react-native`,
on the `0.68.7-zulip` branch.

- Update the `package.json`:

```json
"react-native": "zulip/react-native#<commit-id>",
```

- Run `yarn`.

When building for Android, it will take longer the first time because
React Native is built from source. (`react-native` releases on NPM,
which we've been using until recently, come with a pre-built binary.)
190 changes: 0 additions & 190 deletions docs/howto/rn-from-git.md

This file was deleted.

2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ SPEC CHECKSUMS:
EXScreenOrientation: e3c072fb0add472a3037482ea43ccbade9b88a25
EXSQLite: 2b9accd925438293f9f39e0a57a08cca13bdffb2
FBLazyVector: 63b89dc85804d5817261f56dc4cfb43a9b6d57f5
FBReactNativeSpec: 1fa200a9862d9369a53b6fddbbfcdc22bab24062
FBReactNativeSpec: de66c1e28c6823a30a53b51dd933560edb24ed3f
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 476ee3e89abb49e07f822b48323c51c57124b572
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lodash.uniq": "^4.5.0",
"react": "17.0.2",
"react-intl": "5.24.6",
"react-native": "0.68.7",
"react-native": "zulip/react-native#b7b2f6c22",
"react-native-document-picker": "^8.1.3",
"react-native-gesture-handler": "^2.8.0",
"react-native-image-picker": "^5.3.1",
Expand Down
Loading
Loading