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

Bump React Native to 0.73.x #1698

Merged
merged 20 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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 .github/workflows/fastlane_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'gradle'
- name: Find Metro cache
id: metro-cache-dir-path
Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.12'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

gem "cocoapods-user-defined-build-types"

Expand Down
16 changes: 8 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

apply plugin: "com.google.gms.google-services"
Expand Down Expand Up @@ -78,8 +79,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion

flavorDimensions "default"

Expand All @@ -104,6 +105,11 @@ android {
// https://github.com/luggit/react-native-config#advanced-android-setup
resValue "string", "build_config_package", "fr.coopcycle"
}
packagingOptions {
jniLibs {
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
}
}
signingConfigs {
release {
// Caution! In production, you need to generate your own keystore file.
Expand Down Expand Up @@ -160,13 +166,7 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
implementation("com.facebook.react:flipper-integration")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
Expand Down
4 changes: 1 addition & 3 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>
75 changes: 0 additions & 75 deletions android/app/src/debug/java/fr/coopcycle/ReactNativeFlipper.java

This file was deleted.

65 changes: 0 additions & 65 deletions android/app/src/main/java/fr/coopcycle/MainActivity.java

This file was deleted.

64 changes: 64 additions & 0 deletions android/app/src/main/java/fr/coopcycle/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package fr.coopcycle

import expo.modules.ReactActivityDelegateWrapper

import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.WindowManager

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {

override fun onCreate(savedInstanceState: Bundle?) {

// On Android the View state is not persisted consistently across Activity restarts, which can lead to crashes in those cases.
// It is recommended to override the native Android method called on Activity restarts in your main Activity, to avoid these crashes.
// https://github.com/software-mansion/react-native-screens#android
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704633
super.onCreate(null)

// @see https://github.com/invertase/react-native-firebase/issues/2791
// @see https://developer.android.com/training/notify-user/channels
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

val notificationChannel = NotificationChannel(
"coopcycle_important",
"Service Updates",
NotificationManager.IMPORTANCE_HIGH
)
notificationChannel.description = "CoopCycle Service Updates"

val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(notificationChannel)
}
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "CoopCycle"

/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate {
return ReactActivityDelegateWrapper(
this,
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
object : DefaultReactActivityDelegate(
this,
mainComponentName,
fabricEnabled
){})
}
}
97 changes: 0 additions & 97 deletions android/app/src/main/java/fr/coopcycle/MainApplication.java

This file was deleted.

Loading
Loading