Edit this page
View file-by-file diffs of all the changes you need to make to your native projects to upgrade them to the next Expo SDK version.
If you manage your native projects (previously known as bare workflow), to upgrade to the latest Expo SDK, you have to make changes to your native projects. It can be a complex process to find which native file changes and what to update in which file.
The following guide provides diffs to compare native project files between your project's current SDK version and the target SDK version you want to upgrade. You can use them to make changes to your project depending on the expo
package version your project uses. The tools on this page are similar to React Native Upgrade Helper. However, they are oriented around projects that use Expo modules and related tooling.
Interested in avoiding upgrading native code altogether? See Continuous Native Generation (CNG) to learn how Expo Prebuild can generate your native projects before a build.
Once you have upgraded your Expo SDK version and related dependencies, use the diff tool below to learn about changes you need to make to your native project and bring them up to date with the current Expo SDK version.
Choose your from SDK version and to SDK version to see the generated diff. Then, apply those changes to your native projects by copying and pasting or manually making changes to the project files.
4 | 4 | |
5 | 5 | def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath() |
6 | 6 | |
7 | static def versionToNumber(major, minor, patch) { | |
8 | return patch * 100 + minor * 10000 + major * 1000000 | |
9 | } | |
10 | ||
11 | def getRNVersion() { | |
12 | def version = providers.exec { | |
13 | workingDir(projectDir) | |
14 | commandLine("node", "-e", "console.log(require('react-native/package.json').version);") | |
15 | }.standardOutput.asText.get().trim() | |
16 | ||
17 | def coreVersion = version.split("-")[0] | |
18 | def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() } | |
19 | ||
20 | return versionToNumber( | |
21 | major, | |
22 | minor, | |
23 | patch | |
24 | ) | |
25 | } | |
26 | def rnVersion = getRNVersion() | |
27 | ||
28 | 7 | /** |
29 | 8 | * This is the configuration block to customize your React Native Android app. |
30 | 9 | * By default you don't need to apply any configuration, just uncomment the lines you need. |
41 | 20 | bundleCommand = "export:embed" |
42 | 21 | |
43 | 22 | /* Folders */ |
44 | // The root of your project, i.e. where "package.json" lives. Default is '..' | |
45 | // root = file("../") | |
46 | // The folder where the react-native NPM package is. Default is ../node_modules/react-native | |
47 | // reactNativeDir = file("../node_modules/react-native") | |
48 | // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen | |
49 | // codegenDir = file("../node_modules/@react-native/codegen") | |
23 | // The root of your project, i.e. where "package.json" lives. Default is '../..' | |
24 | // root = file("../../") | |
25 | // The folder where the react-native NPM package is. Default is ../../node_modules/react-native | |
26 | // reactNativeDir = file("../../node_modules/react-native") | |
27 | // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen | |
28 | // codegenDir = file("../../node_modules/@react-native/codegen") | |
50 | 29 | |
51 | 30 | /* Variants */ |
52 | 31 | // The list of variants to that are debuggable. For those we're going to |
79 | 58 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" |
80 | 59 | // hermesFlags = ["-O", "-output-source-map"] |
81 | 60 | |
82 | if (rnVersion >= versionToNumber(0, 75, 0)) { | |
83 | /* Autolinking */ | |
84 | autolinkLibrariesWithApp() | |
85 | } | |
61 | /* Autolinking */ | |
62 | autolinkLibrariesWithApp() | |
86 | 63 | } |
87 | 64 | |
88 | 65 | /** |
144 | 121 | useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false) |
145 | 122 | } |
146 | 123 | } |
124 | androidResources { | |
125 | ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~' | |
126 | } | |
147 | 127 | } |
148 | 128 | |
149 | 129 | // Apply static values from `gradle.properties` to the `android.packagingOptions` |
194 | 174 | implementation jscFlavor |
195 | 175 | } |
196 | 176 | } |
197 | ||
198 | if (rnVersion < versionToNumber(0, 75, 0)) { | |
199 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); | |
200 | applyNativeModulesAppBuildGradle(project) | |
201 | } |
18 | 18 | </intent> |
19 | 19 | </queries> |
20 | 20 | |
21 | <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme"> | |
21 | <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:supportsRtl="true"> | |
22 | 22 | <activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true"> |
23 | 23 | <intent-filter> |
24 | 24 | <action android:name="android.intent.action.MAIN"/> |
10 | 10 | import com.facebook.react.ReactHost |
11 | 11 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load |
12 | 12 | import com.facebook.react.defaults.DefaultReactNativeHost |
13 | import com.facebook.react.soloader.OpenSourceMergedSoMapping | |
13 | 14 | import com.facebook.soloader.SoLoader |
14 | 15 | |
15 | 16 | import expo.modules.ApplicationLifecycleDispatcher |
21 | 22 | this, |
22 | 23 | object : DefaultReactNativeHost(this) { |
23 | 24 | override fun getPackages(): List<ReactPackage> { |
25 | val packages = PackageList(this).packages | |
24 | 26 | // Packages that cannot be autolinked yet can be added manually here, for example: |
25 | 27 | // packages.add(new MyReactNativePackage()); |
26 | return PackageList(this).packages | |
28 | return packages | |
27 | 29 | } |
28 | 30 | |
29 | 31 | override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry" |
40 | 42 | |
41 | 43 | override fun onCreate() { |
42 | 44 | super.onCreate() |
43 | SoLoader.init(this, false) | |
45 | SoLoader.init(this, OpenSourceMergedSoMapping) | |
44 | 46 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { |
45 | 47 | // If you opted-in for the New Architecture, we load the native entry point for this app. |
46 | 48 | load() |
2 | 2 | |
3 | 3 | buildscript { |
4 | 4 | ext { |
5 | buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0' | |
6 | minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23') | |
7 | compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34') | |
5 | buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0' | |
6 | minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24') | |
7 | compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35') | |
8 | 8 | targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34') |
9 | kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23' | |
9 | kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24' | |
10 | 10 | |
11 | 11 | ndkVersion = "26.1.10909125" |
12 | 12 | } |
22 | 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn |
23 | 23 | android.useAndroidX=true |
24 | 24 | |
25 | # Automatically convert third-party libraries to use AndroidX | |
26 | android.enableJetifier=true | |
27 | ||
28 | 25 | # Enable AAPT2 PNG crunching |
29 | 26 | android.enablePngCrunchInReleaseBuilds=true |
30 | 27 |
1 | 1 | distributionBase=GRADLE_USER_HOME |
2 | 2 | distributionPath=wrapper/dists |
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip | |
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip | |
4 | 4 | networkTimeout=10000 |
5 | 5 | validateDistributionUrl=true |
6 | 6 | zipStoreBase=GRADLE_USER_HOME |
15 | 15 | # See the License for the specific language governing permissions and |
16 | 16 | # limitations under the License. |
17 | 17 | # |
18 | # SPDX-License-Identifier: Apache-2.0 | |
19 | # | |
18 | 20 | |
19 | 21 | ############################################################################## |
20 | 22 | # |
55 | 57 | # Darwin, MinGW, and NonStop. |
56 | 58 | # |
57 | 59 | # (3) This script is generated from the Groovy template |
58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |
59 | 61 | # within the Gradle project. |
60 | 62 | # |
61 | 63 | # You can find Gradle at https://github.com/gradle/gradle/. |
84 | 86 | # shellcheck disable=SC2034 |
85 | 87 | APP_BASE_NAME=${0##*/} |
86 | 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) |
87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit | |
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s | |
90 | ' "$PWD" ) || exit | |
88 | 91 | |
89 | 92 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
90 | 93 | MAX_FD=maximum |
13 | 13 | @rem See the License for the specific language governing permissions and |
14 | 14 | @rem limitations under the License. |
15 | 15 | @rem |
16 | @rem SPDX-License-Identifier: Apache-2.0 | |
17 | @rem | |
16 | 18 | |
17 | 19 | @if "%DEBUG%"=="" @echo off |
18 | 20 | @rem ########################################################################## |
1 | 1 | pluginManagement { |
2 | def version = providers.exec { | |
3 | commandLine("node", "-e", "console.log(require('react-native/package.json').version);") | |
4 | }.standardOutput.asText.get().trim() | |
5 | def (_, reactNativeMinor, reactNativePatch) = version.split("-")[0].tokenize('.').collect { it.toInteger() } | |
6 | ||
7 | includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile().toString()) | |
8 | if(reactNativeMinor == 74 && reactNativePatch <= 3){ | |
9 | includeBuild("react-settings-plugin") | |
10 | } | |
2 | includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile().toString()) | |
11 | 3 | } |
12 | ||
13 | 4 | plugins { id("com.facebook.react.settings") } |
14 | 5 | |
15 | def getRNMinorVersion() { | |
16 | def version = providers.exec { | |
17 | commandLine("node", "-e", "console.log(require('react-native/package.json').version);") | |
18 | }.standardOutput.asText.get().trim() | |
19 | ||
20 | def coreVersion = version.split("-")[0] | |
21 | def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() } | |
22 | ||
23 | return minor | |
24 | } | |
25 | ||
26 | if (getRNMinorVersion() >= 75) { | |
27 | extensions.configure(com.facebook.react.ReactSettingsExtension) { ex -> | |
28 | if (System.getenv('EXPO_UNSTABLE_CORE_AUTOLINKING') == '1') { | |
29 | println('\u001B[32mUsing expo-modules-autolinking as core autolinking source\u001B[0m') | |
30 | def command = [ | |
31 | 'node', | |
32 | '--no-warnings', | |
33 | '--eval', | |
34 | 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))', | |
35 | 'react-native-config', | |
36 | '--json', | |
37 | '--platform', | |
38 | 'android' | |
39 | ].toList() | |
40 | ex.autolinkLibrariesFromCommand(command) | |
41 | } else { | |
42 | ex.autolinkLibrariesFromCommand() | |
43 | } | |
6 | extensions.configure(com.facebook.react.ReactSettingsExtension) { ex -> | |
7 | if (System.getenv('EXPO_USE_COMMUNITY_AUTOLINKING') == '1') { | |
8 | ex.autolinkLibrariesFromCommand() | |
9 | } else { | |
10 | def command = [ | |
11 | 'node', | |
12 | '--no-warnings', | |
13 | '--eval', | |
14 | 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))', | |
15 | 'react-native-config', | |
16 | '--json', | |
17 | '--platform', | |
18 | 'android' | |
19 | ].toList() | |
20 | ex.autolinkLibrariesFromCommand(command) | |
44 | 21 | } |
45 | 22 | } |
46 | 23 | |
57 | 34 | apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle"); |
58 | 35 | useExpoModules() |
59 | 36 | |
60 | if (getRNMinorVersion() < 75) { | |
61 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle"); | |
62 | applyNativeModulesSettingsGradle(settings) | |
63 | } | |
64 | ||
65 | 37 | include ':app' |
66 | 38 | includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile()) |
287 | 287 | "FB_SONARKIT_ENABLED=1", |
288 | 288 | ); |
289 | 289 | INFOPLIST_FILE = HelloWorld/Info.plist; |
290 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; | |
290 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; | |
291 | 291 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
292 | 292 | MARKETING_VERSION = 1.0; |
293 | 293 | OTHER_LDFLAGS = ( |
311 | 311 | CLANG_ENABLE_MODULES = YES; |
312 | 312 | CURRENT_PROJECT_VERSION = 1; |
313 | 313 | INFOPLIST_FILE = HelloWorld/Info.plist; |
314 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; | |
314 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; | |
315 | 315 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
316 | 316 | MARKETING_VERSION = 1.0; |
317 | 317 | OTHER_LDFLAGS = ( |
373 | 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; |
374 | 374 | GCC_WARN_UNUSED_FUNCTION = YES; |
375 | 375 | GCC_WARN_UNUSED_VARIABLE = YES; |
376 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; | |
376 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; | |
377 | 377 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; |
378 | 378 | LIBRARY_SEARCH_PATHS = "\"$(inherited)\""; |
379 | 379 | MTL_ENABLE_DEBUG_INFO = YES; |
422 | 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; |
423 | 423 | GCC_WARN_UNUSED_FUNCTION = YES; |
424 | 424 | GCC_WARN_UNUSED_VARIABLE = YES; |
425 | IPHONEOS_DEPLOYMENT_TARGET = 13.4; | |
425 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; | |
426 | 426 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; |
427 | 427 | LIBRARY_SEARCH_PATHS = "\"$(inherited)\""; |
428 | 428 | MTL_ENABLE_DEBUG_INFO = NO; |
7 | 7 | ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0' |
8 | 8 | ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR'] |
9 | 9 | |
10 | use_autolinking_method_symbol = ('use' + '_native' + '_modules!').to_sym | |
11 | origin_autolinking_method = self.method(use_autolinking_method_symbol) | |
12 | self.define_singleton_method(use_autolinking_method_symbol) do |*args| | |
13 | if ENV['EXPO_UNSTABLE_CORE_AUTOLINKING'] == '1' | |
14 | Pod::UI.puts('Using expo-modules-autolinking as core autolinking source'.green) | |
10 | platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1' | |
11 | install! 'cocoapods', | |
12 | :deterministic_uuids => false | |
13 | ||
14 | prepare_react_native_project! | |
15 | ||
16 | target 'HelloWorld' do | |
17 | use_expo_modules! | |
18 | ||
19 | if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1' | |
20 | config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"]; | |
21 | else | |
15 | 22 | config_command = [ |
16 | 23 | 'node', |
17 | 24 | '--no-warnings', |
22 | 29 | '--platform', |
23 | 30 | 'ios' |
24 | 31 | ] |
25 | origin_autolinking_method.call(config_command) | |
26 | else | |
27 | origin_autolinking_method.call() | |
28 | 32 | end |
29 | end | |
30 | 33 | |
31 | platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4' | |
32 | install! 'cocoapods', | |
33 | :deterministic_uuids => false | |
34 | ||
35 | prepare_react_native_project! | |
36 | ||
37 | target 'HelloWorld' do | |
38 | use_expo_modules! | |
39 | config = use_native_modules! | |
34 | config = use_native_modules!(config_command) | |
40 | 35 | |
41 | 36 | use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks'] |
42 | 37 | use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS'] |
68 | 63 | end |
69 | 64 | end |
70 | 65 | end |
71 | ||
72 | post_integrate do |installer| | |
73 | begin | |
74 | expo_patch_react_imports!(installer) | |
75 | rescue => e | |
76 | Pod::UI.warn e | |
77 | end | |
78 | end | |
79 | 66 | end |
1 | 1 | { |
2 | 2 | "name": "expo-template-bare-minimum", |
3 | 3 | "description": "This bare project template includes a minimal setup for using unimodules with React Native.", |
4 | "version": "51.0.56", | |
4 | "license": "0BSD", | |
5 | "version": "52.0.2", | |
5 | 6 | "main": "index.js", |
6 | 7 | "scripts": { |
7 | 8 | "start": "expo start --dev-client", |
10 | 11 | "web": "expo start --web" |
11 | 12 | }, |
12 | 13 | "dependencies": { |
13 | "expo": "~51.0.28", | |
14 | "expo-status-bar": "~1.12.1", | |
15 | "react": "18.2.0", | |
16 | "react-native": "0.74.5" | |
14 | "expo": "~52.0.0-preview.2", | |
15 | "expo-status-bar": "~2.0.0", | |
16 | "react": "18.3.1", | |
17 | "react-native": "0.76.0" | |
17 | 18 | }, |
18 | 19 | "devDependencies": { |
19 | 20 | "@babel/core": "^7.20.0" |