Skip to content

Commit 86fdfb3

Browse files
committed
chore: update example app to latest RN version 0.76.2
1 parent 847f855 commit 86fdfb3

File tree

23 files changed

+2552
-347
lines changed

23 files changed

+2552
-347
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ jobs:
195195
196196
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
197197
echo "turbo_cache_hit=1" >> $GITHUB_ENV
198+
else
199+
echo "turbo_cache_hit=0" >> $GITHUB_ENV
198200
fi
199201
200202
- name: Cache cocoapods
@@ -212,7 +214,7 @@ jobs:
212214
if: env.turbo_cache_hit != 1 || steps.cocoapods-cache.outputs.cache-hit != 'true'
213215
run: |
214216
cd example/ios
215-
pod install
217+
RCT_NEW_ARCH_ENABLED=0 pod install
216218
env:
217219
NO_FLIPPER: 1
218220

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 18.20.1

android/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ if (isNewArchitectureEnabled()) {
3939

4040
android {
4141
namespace "com.google.android.react.navsdk"
42-
43-
compileSdkVersion 31
42+
compileSdkVersion 34
4443

4544
compileOptions {
4645
sourceCompatibility JavaVersion.VERSION_1_8
@@ -49,7 +48,7 @@ android {
4948

5049
defaultConfig {
5150
minSdkVersion 23
52-
targetSdkVersion 31
51+
targetSdkVersion 34
5352
versionCode 1
5453
// get version name from package.json version
5554
versionName "1.0"
@@ -76,7 +75,6 @@ dependencies {
7675
implementation "androidx.car.app:app:1.4.0"
7776
implementation "androidx.car.app:app-projected:1.4.0"
7877
implementation 'com.facebook.react:react-native:+'
79-
implementation 'com.android.support:multidex:1.0.3'
8078
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
8179
implementation "com.google.android.libraries.navigation:navigation:6.0.0"
8280
api 'com.google.guava:guava:31.0.1-android'

example/Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ source 'https://rubygems.org'
1717
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
1818
ruby ">= 2.6.10"
1919

20-
# Cocoapods 1.15 introduced a bug which break the build. The upper
21-
# bound in can be removed with next React Native release >0.74.1.
22-
gem 'cocoapods', '>= 1.13', '< 1.15'
23-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
20+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
21+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
22+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
23+
gem 'xcodeproj', '< 1.26.0'

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ First, make sure you go through the setup from the main [README](../README.md).
2020

2121
1. Using your preferred terminal, go to example/ios folder and run the command below.
2222

23-
`pod install` or `yarn prepare`
23+
`RCT_NEW_ARCH_ENABLED=0 pod install`
2424

2525
2. Copy the `Keys.plist.sample` file located in `example/ios/SampleApp/` to a new file named `Keys.plist`. This file is git ignored and won't be accidentally committed. In your Google cloud console, add the Google API key to the project and add this newly created API key to the `Keys.plist` file.
2626

example/android/app/build.gradle

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ apply plugin: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
2222
*/
2323
react {
2424
/* Folders */
25-
// The root of your project, i.e. where "package.json" lives. Default is '..'
26-
// root = file("../")
27-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
28-
// reactNativeDir = file("../node_modules/react-native")
29-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
30-
// codegenDir = file("../node_modules/@react-native/codegen")
31-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
32-
// cliFile = file("../node_modules/react-native/cli.js")
25+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
26+
// root = file("../../")
27+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
28+
// reactNativeDir = file("../../node_modules/react-native")
29+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
30+
// codegenDir = file("../../node_modules/@react-native/codegen")
31+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
32+
// cliFile = file("../../node_modules/react-native/cli.js")
3333

3434
/* Variants */
3535
// The list of variants to that are debuggable. For those we're going to
@@ -63,6 +63,12 @@ react {
6363
//
6464
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
6565
// hermesFlags = ["-O", "-output-source-map"]
66+
67+
/* This example app uses typescript index file, so we need to specify the entry file */
68+
entryFile = file("index.ts")
69+
70+
/* Autolinking */
71+
autolinkLibrariesWithApp()
6672
}
6773

6874
/**
@@ -116,6 +122,11 @@ android {
116122
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
117123
}
118124
}
125+
compileOptions {
126+
coreLibraryDesugaringEnabled true
127+
sourceCompatibility JavaVersion.VERSION_17
128+
targetCompatibility JavaVersion.VERSION_17
129+
}
119130
}
120131

121132
dependencies {
@@ -128,10 +139,15 @@ dependencies {
128139
implementation jscFlavor
129140
}
130141

131-
// For Android Auto Sample support
142+
// Include packages for the Android Auto support.
132143
implementation "androidx.car.app:app:1.4.0"
133144
implementation "androidx.car.app:app-projected:1.4.0"
145+
146+
// Include the Google Navigation SDK.
134147
implementation 'com.google.android.libraries.navigation:navigation:6.0.0'
148+
149+
// Desugar Java 8+ APIs
150+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'
135151
}
136152

137153
secrets {
@@ -149,5 +165,3 @@ secrets {
149165
// Ignore all keys matching the regexp "sdk.*"
150166
ignoreList.add("sdk.*")
151167
}
152-
153-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<application
2323
android:usesCleartextTraffic="true"
24-
tools:targetApi="28"
24+
tools:targetApi="34"
2525
tools:ignore="GoogleAppIndexingWarning">
2626
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
2727
</application>

example/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
android:icon="@mipmap/ic_launcher"
3333
android:roundIcon="@mipmap/ic_launcher_round"
3434
android:allowBackup="false"
35-
android:theme="@style/AppTheme">
35+
android:theme="@style/AppTheme"
36+
android:supportsRtl="true">
3637
<activity
3738
android:name=".MainActivity"
3839
android:label="@string/app_name"

example/android/app/src/main/java/com/sampleapp/MainApplication.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
package com.sampleapp;
1818

1919
import android.app.Application;
20+
import androidx.annotation.NonNull;
2021
import com.facebook.react.PackageList;
2122
import com.facebook.react.ReactApplication;
2223
import com.facebook.react.ReactNativeHost;
2324
import com.facebook.react.ReactPackage;
2425
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
2526
import com.facebook.react.defaults.DefaultReactNativeHost;
27+
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
2628
import com.facebook.soloader.SoLoader;
29+
import java.io.IOException;
2730
import java.util.List;
2831

2932
public class MainApplication extends Application implements ReactApplication {
@@ -60,6 +63,7 @@ protected Boolean isHermesEnabled() {
6063
}
6164
};
6265

66+
@NonNull
6367
@Override
6468
public ReactNativeHost getReactNativeHost() {
6569
return mReactNativeHost;
@@ -68,7 +72,11 @@ public ReactNativeHost getReactNativeHost() {
6872
@Override
6973
public void onCreate() {
7074
super.onCreate();
71-
SoLoader.init(this, /* native exopackage */ false);
75+
try {
76+
SoLoader.init(this, OpenSourceMergedSoMapping.INSTANCE);
77+
} catch (IOException e) {
78+
throw new RuntimeException(e);
79+
}
7280
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
7381
// If you opted-in for the New Architecture, we load the native entry point for this app.
7482
DefaultNewArchitectureEntryPoint.load();

example/android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
buildscript {
1616
ext {
17-
buildToolsVersion = "34.0.0"
18-
minSdkVersion = 23
19-
compileSdkVersion = 34
17+
buildToolsVersion = "35.0.0"
18+
minSdkVersion = 24
19+
compileSdkVersion = 35
2020
targetSdkVersion = 34
2121
ndkVersion = "26.1.10909125"
2222
}
@@ -25,7 +25,7 @@ buildscript {
2525
mavenCentral()
2626
}
2727
dependencies {
28-
classpath('com.android.tools.build:gradle:8.4.0')
28+
classpath('com.android.tools.build:gradle:8.6.1')
2929
classpath("com.facebook.react:react-native-gradle-plugin")
3030
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
3131
}

0 commit comments

Comments
 (0)