title | description |
---|---|
Upgrade Expo SDK |
Learn how to incrementally upgrade the Expo SDK version in your project. |
import { Terminal } from '/ui/components/Snippet';
import { Step } from '/ui/components/Step';
import { Tabs, Tab } from '~/ui/components/Tabs';
info We recommend upgrading SDK versions incrementally, one at a time. Doing so will help you pinpoint breakages and issues that arise during the upgrade process.
With a new SDK release, the latest version enters the current release status. This applies to Expo Go as it only supports the latest SDK version and previous versions are no longer supported. We recommend using development builds for production apps as the backwards compatibility for older SDK versions on EAS services tends to be much longer, but not forever.
If you are looking to install a specific version of Expo Go, visit expo.dev/go. It supports downloads for Android devices/emulators and iOS simulators. However, due to iOS platform restrictions, only the latest version of Expo Go is available for installation on physical iOS devices.
Install the new version of the Expo package:
<Terminal cmd={[ '# Install latest', '$ npm install expo@latest', '', '# Install a specific SDK version (for example, SDK 50)', '$ npm install expo@50', ]} />
<Terminal cmd={[ '# Install latest', '$ yarn add expo@latest', '', '# Install a specific SDK version (for example, SDK 50)', '$ yarn add expo@50', ]} />
Upgrade all dependencies to match the installed SDK version.
<Terminal cmd={['$ npx expo install --fix']} />
Read the SDK changelogs for the SDK version you are upgrading to. They contain important information about breaking changes, deprecations, and other changes that may affect your app.
If you manage your own native projects, you will need to manually apply any changes to your native android and ios project directories. Our native project upgrade helper will show you a diff that describes the changes you need to make. Alternatively, you could consider adopting prebuild for easier upgrades in the future.
Each SDK announcement blog post contains deprecations, breaking changes, and anything else that might be unique to that particular SDK version. When upgrading, be sure to check these out to make sure you don't miss anything.
- Run
expo update 35.0.0
- There are a few small breaking API changes with this release. See the changelog for the full list.
- Run
expo update 34.0.0
- You will need to update your imports to match the new modular format. For example, if you currently have
import { FileSystem } from 'expo';
, you will need to runnpx expo install expo-file-system
and then change your import toimport * as FileSystem from 'expo-file-system';
. We provide a codemod to help automate this. - There are a few small breaking API changes with this release. See the changelog for the full list.
- app.json, change
sdkVersion
to"33.0.0"
, - In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"expo": "^33.0.0",
"react": "16.8.3"
}
- Delete your project's node_modules directory and run
npm install
again
- You will need to update your imports to match the new modular format. For example, if you currently have
import { FileSystem } from 'expo';
, you will need to runnpx expo install expo-file-system
and then change your import toimport * as FileSystem from 'expo-file-system';
. We provide a codemod to help automate this. - There are several small breaking API changes with this release. See the changelog for the full list.
- app.json, change
sdkVersion
to"32.0.0"
, - In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"expo": "^32.0.0",
"react": "16.5.0"
}
- If using the default
.babelrc
, change it to babel.config.js:
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
- Delete your project's node_modules directory and run
npm install
again
- There are several small breaking API changes with this release. See the changelog for the full list.
- app.json, change
sdkVersion
to"31.0.0"
, - In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
"expo": "^31.0.0",
"react": "16.5.0"
}
- Delete your project's node_modules directory and run
npm install
again
- There are several small breaking API changes with this release. See the changelog for the full list.
- app.json, change
sdkVersion
to"30.0.0"
, - In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
"expo": "^30.0.0",
"react": "16.3.1"
}
- Delete your project's node_modules directory and run
npm install
again
Fingerprint
has been renamed toLocalAuthentication
- app.json, change
sdkVersion
to"29.0.0"
, - In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
"expo": "^29.0.0",
"react": "16.3.1"
}
- Delete your project's node_modules directory and run
npm install
again
- Some field names in
Contacts
were changed. See the documentation for more information.
- app.json, change
sdkVersion
to"28.0.0"
, - In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz",
"expo": "^28.0.0",
"react": "16.3.1"
}
- Delete your project's node_modules directory and run
npm install
again
- Android apps on all SDK versions now require notification channels for push notifications. This may impact you even if you don't yet use SDK 28. Read this blog post for all of the necessary information.
- Android app icons are now coerced into adaptive icons. Be sure to test your app icon and supply an adaptive icon if needed. Read this blog post for all of the necessary information.
- Print has been moved out of DangerZone; update your imports accordingly.
- In app.json, change sdkVersion to
"27.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz",
"expo": "^27.0.0",
"react": "16.3.1"
}
- Delete your project's node_modules directory and run
npm install
again
View.propTypes
has been removed from React Native, so if your code (or any of your dependent libraries) uses it, that will break. UseViewPropTypes
instead. We strongly recommend running your app with the dev flag disabled to test whether it's affected by this change.- We changed the format of
Constants.linkingUri
(see Linking changes above), so if your code makes assumptions about this, you should double check that. - Camera roll permissions are now required to use ImagePicker.launchCameraAsync() and ImagePicker.launchImageLibraryAsync(). You can ask for them by calling
Permissions.askAsync(Permissions.CAMERA_ROLL)
.
- In app.json, change sdkVersion to
"26.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz",
"expo": "^26.0.0",
"react": "16.3.0-alpha.1"
}
- Delete your project's node_modules directory and run
npm install
again
Expo.Util
is deprecated, functionality has been moved out toExpo.DangerZone.Localization
andExpo.Updates
.ios.loadJSInBackgroundExperimental
is now deprecated, use the newUpdates
API instead. The equivalent of this configuration isupdates.fallbackToCacheTimeout: 0
.isRemoteJSEnabled
is also deprecated, useupdates.enabled
instead.- React Native 0.54 depends on React 16.3.0-alpha.1. React 16.3 deprecates the usage of
componentWillMount
,componentWillReceiveProps
, andcomponentWillUpdate
. These have been replaced with static lifecycle methods:getDerivedStateFromProps
andgetSnapshotBeforeUpdate
, but onlygetDerivedStateFromProps
is available in 16.3.0-alpha.1. - On iOS,
WebBrowser.dismissBrowser()
promise now resolves with{type:'dismiss}
rather than{type:'dismissed'}
to match Android - AdMob method name changes.
requestAd
torequestAdAsync
,showAd
toshowAdAsync
,isReady
togetIsReadyAsync
. - On iOS, Contacts
urls
was renamed tourlAddresses
to match Android. Related commit. - On iOS, calling
Notifications.getExpoPushToken()
will throw an error if you don't have permission to send notifications. We recommend callPermissions.getAsync(Permissions.NOTIFICATIONS)
and, if needed and you haven't asked before,Permissions.askAsync(Permissions.NOTIFICATIONS)
before getting push token. - React Native 0.53.0 removed the TextInput autoGrow prop. Commit.
- In app.json, change sdkVersion to
"25.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
"expo": "^25.0.0",
"react": "16.2.0"
}
- Delete your project's node_modules directory and run
npm install
again
- If you have any scripts in your project that depend on
metro-bundler
, you will need to change those tometro
(related commit). A likely place for this is inrn-cli.config.js
. - Although not technically part of the SDK, React Navigation is commonly used by Expo users, and it's worth mentioning that on Android React Navigation now properly accounts for the translucent status bar. This may require you to remove code that you have to workaround that (maybe a paddingTop somewhere to avoid the content from rendering underneath the status bar). Read the React Navigation release notes for more information. Only applies to
react-navigation@1.0.0-beta.26
and higher.
- In app.json, change sdkVersion to
"24.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz",
"expo": "^24.0.0",
"react": "16.0.0"
}
- Delete your project's node_modules directory and run
npm install
again
The following APIs have been removed after being deprecated for a minimum of 2 releases:
Expo.LegacyAsyncStorage
Expo.Font.style
- Passing an object into
Expo.SQLite.openDatabase()
instead of separate arguments is no longer supported.
- In app.json, change sdkVersion to
"23.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-23.0.0.tar.gz",
"expo": "^23.0.0",
"react": "16.0.0"
}
- Delete your project's node_modules directory and run
npm install
again
- React Native no longer supports nesting components inside of
<Image>
— some developers used this to use an image as a background behind other views. To fix this in your app, replace theImage
component anywhere where you are nesting views inside of it with theImageBackground
component, like this:
<View style={styles.container}>
<ImageBackground
source={require('./path/to/image.png')}
style={{
width: 280,
alignItems: 'center',
justifyContent: 'center',
padding: 30,
}}>
<Text style={{ color: '#fff', fontSize: 18 }}>
The universe... what a concept. You know, the universe is a little bit like the human hand.
For example, you have groundmen's center right here and then you have undiscovered worlds and
uh, um and sector 8 and up here is tittleman's crest so you can kinda picture it's a little
bit like a leaf or uhh, umm, it's not a bowl.
</Text>
</ImageBackground>
</View>
- React Native now defaults
enableBabelRCLookup
(recursive) tofalse
in Metro bundler (the default bundler for React Native). This is unlikely to cause any problems for your application — in our case, this lets us remove a script to delete nested.babelrc
files fromnode_modules
in our postinstall. If you run into transform errors when updating your app, read this commit message for more information and to see how to opt-in to the old behavior.
- In app.json, change sdkVersion to
"22.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-22.0.1.tar.gz",
"expo": "^22.0.0",
"react": "16.0.0-beta.5"
}
- Delete your project's node_modules directory and run
npm install
again
Metro Bundler (the default React Native bundler) now errors (instead of silently ignoring) dynamic requires. In particular this breaks an older version of moment.js if you were using that (or indirectly depending on it).
- This is a known issue with Metro which is being tracked on the project's GitHub issues.
- If you use moment.js in your app, you may have success with this fix.
Several deprecated APIs have been removed. All of these APIs printed warning messages in previous releases:
Expo.Notifications.getExponentPushToken
is nowExpo.Notifications.getExpoPushToken
.Expo.AdMob.AdMobInterstitials.tryShowNewInterstitial
has been removed in favor ofrequestAd
andshowAd
.Expo.Segment.initializeAndroid
andinitializeIOS
have been removed in favor ofExpo.Segment.initialize
.- The
tintEffect
prop ofExpo.BlurView
has been removed in favor of the tint prop. Expo.SecureStore.setValueWithKeyAsync
,getValueWithKeyAsync
, anddeleteValueWithKeyAsync
are nowsetItemAsync
,getItemAsync
, anddeleteItemAsync
. The order of arguments tosetValueWithKeyAsync
changed from(value, key)
to(key, value)
.- The
callback
prop ofExpo.Video
andExpo.Audio
is nowonPlaybackStatusUpdate
. This is not a breaking change yet but we plan to removeLegacyAsyncStorage
in SDK 24. If you, or any libraries that you use. useView.propTypes.style
you will need to change that toViewPropTypes.style
.
If you have not yet updated your imports of PropTypes
as warned in deprecation warnings in previous releases, you will need to do this now. Install the prop-types
package and import PropTypes from 'prop-types'
; instead of import { PropTypes } from React;
!
Similarly, if you depend on React.createClass
, you will need to install the create-react-class
package and import createReactClass from 'create-react-class';
as described in the React documentation.
- In app.json, change sdkVersion to
"21.0.0"
- In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
"expo": "^21.0.0",
"react": "16.0.0-alpha.12"
}
- Delete your project's node_modules directory and run
npm install
again
Camera
-
The takePicture function is now called
takePictureAsync
and now returns an object with many keys, instead of just returning the URI. The URI is available under theuri
key of the returned object. -
Previously this function would return a value like:
"file://path/to/your/file.jpg"
-
And will now return an object like:
{ "uri": "file://path/to/your/file.jpg" }
Secure Store
setValueWithKeyAsync
→setItemAsync
: The order of the arguments has been reversed to match typical key-value store APIs. This function used to expect(value, key)
and now expects(key, value)
.getValueWithKeyAsync
→getItemAsync
: Trying to retrieve an entry that doesn't exist returnsnull
instead of throwing an error.deleteValueWithKeyAsync
→deleteItemAsync
Payments
- We had previously announced Stripe support on iOS as part of our experimental DangerZone APIs. The Payments API was using the Stripe SDK on iOS. We learned that Apple sometimes rejects apps that contain the Stripe SDK but doesn't offer anything for sale. To help your App Review process go more smoothly, we have decided to remove the Stripe SDK and experimental Payments API from apps built with the Expo standalone builder. We are still excited to give developers a way to let users pay for goods when they need to and we will announce more ways to do so shortly.