Expo SDK 40 is now available
Tags: react, reactnative, mobile
Published: 2020-12-09 21:01:16

Today we’re announcing our fourth and final SDK release of 2020, Expo SDK 40. SDK 40 includes React Native 0.63, mostly the same version as SDK 39 but with some additional bugfixes cherry-picked on top 🍒. Thank you to everyone that [helped with beta testing](https://dev.to/expo/expo-sdk-40-beta-is-now-available-59gb)!

## ⚡️ Highlights

### Updated icons and types for @expo/vector-icons

@expo/vector-icons has been updated to track the latest icon sets from react-native-vector-icons@7.1.0 (the previously tracked version was 6.6.0). Updated icon sets:

* [MaterialCommunityIcons](https://github.com/templarian/MaterialDesign) to 5.3.45,

* [MaterialIcons](https://github.com/google/material-design-icons) to 4.0.0, [FontAwesome 5](https://github.com/FortAwesome/Font-Awesome) to 5.13.0, and

* [Feather](https://github.com/feathericons/feather) to 4.28.0.

If you use the updated icon sets, please check your app to ensure that every icon that you use is still included.

The update also improves the TypeScript types to add support for autocompletion and validation of the name prop on all icon families.

![Visual Studio Code autocompletion and validation of the name prop on an icon component](https://dev-to-uploads.s3.amazonaws.com/i/49g35jfoyihe3ex2l8ku.gif) 

### Reanimated 2 release candidate available

Now with more *bugfixes and improvements*, the react-native-reanimated v2 release candidate is available in SDK 40! It’s also easier to install: just `yarn add react-native-reanimated@2.0.0-rc.0` and add the Babel plugin, and you're good to go. [Learn more in the documentation](https://docs.expo.io/versions/v40.0.0/sdk/reanimated/).

### Background location is now an opt-in permission on Android

Most users do not use this permission and it raises red flags during Play Store submission, so we’ve decided to make this permission opt-in rather than opt-out (it’s easier to fall into [the pit of success](https://blog.codinghorror.com/falling-into-the-pit-of-success/)).

If you use background location features on Android, you’ll need to add `"ACCESS_BACKGROUND_LOCATION"` to the list of permissions in `android.permissions` in your app configuration file (app.json or app.config.js), if you haven't done so already. More context is available [in this pull request](https://github.com/expo/expo/pull/10989).

### @expo/dev-server is used in all apps SDK 40 and onward

Expo CLI previously started a Metro dev server for transforming, bundling, and serving your app via @react-native-community/cli . We've now decoupled the configuration required to start a Metro server for React Native from React Native CLI and are able to start Metro directly using its public JavaScript API. This has a number of benefits:

* 🚀 Publishing is faster! [An early adopter reported a 33% improvement](https://twitter.com/ryanastelly/status/1293613865331294213), and we’ve seen similar results.

* 🐛 No more ENOSPC errors with expo publish on CI.

* 🔧 File extensions (`sourceExts`) can now be customized in `metro.config.js` rather than `packagerOpts.sourceExts` in `app.config.js` or app.json

* 😬 Running expo publish inside of a project with a running development server no longer kills the Metro process for the development server.

* [A number of other issues were resolved](https://github.com/expo/expo-cli/issues/2322).

If you run into any issues in SDK 40 and suspect this change may be related, you can revert back to using the old process by setting the environment variable `EXPO_USE_DEV_SERVER=0`.

### Expo client & standalone apps are now built with Xcode 12

We switched over expo build for SDK 37+ projects to be built with Xcode 12, and with SDK 40 the Expo client app is now built with Xcode 12 too. This resolves [a confusing inconsistency in between the client and standalone apps around the DateTimePicker UI](https://github.com/expo/expo/issues/11126).

### Constants.manifest is now available in Bare workflow apps

On our quest to continue eliminating any inconsistencies between the Managed and Bare workflow, `Constants.manifest` is now available in Bare workflow apps initialized with expo init or through `expo eject`. To add it to an an existing project, update to the latest version of expo-constants and [follow these instructions](https://github.com/expo/expo/blob/1149d7611183243d178856de3e74f4e0f49e05ac/packages/expo-constants/README.md#optional-set-up-script-to-get-app-config).

### Direct control over entitlements in standalone apps

You can now use the `ios.entitlements` key to customize your app entitlements as needed. For example, you can [add the WiFi Info entitlement so that your standalone apps can access WiFi Network SSIDs](https://docs.expo.io/versions/v40.0.0/sdk/netinfo/#accessing-the-ssid).

### Improvements to expo-notifications

This release fixes two long-standing bugs in expo-notifications: push tokens will no longer remain the same when restoring a device from a backup, *and* listening for notification responses is much more consistent with the new [useLastNotificationResponse](https://docs.expo.io/versions/v40.0.0/sdk/notifications/#uselastnotificationresponse-undefined--notificationresponse--null) hook! There are [plenty of other bug fixes](https://github.com/expo/expo/blob/master/packages/expo-notifications/CHANGELOG.md#-bug-fixes-2), as well as brand new features (like scheduling weekly notifications), but as always make sure to look through [the breaking changes](https://github.com/expo/expo/blob/master/packages/expo-notifications/CHANGELOG.md#-breaking-changes-1) just in case they affect you. Thank you for all the high-quality bug reports that allow us to continually improve libraries like expo-notifications!

## 🍏 Apple App Store privacy update

As of December 8, 2020, new app submissions and updates are required to provide information about their privacy practices in App Store Connect. See [App privacy details on the App Store](https://developer.apple.com/app-store/app-privacy-details/) for more information.

For guidance, please refer to the [Deploying to App Stores guide](https://docs.expo.io/distribution/app-stores/#app-privacy-questions).

## 🌐 Expo CLI

* Expo CLI is now 10% smaller and installs ~12 seconds faster! We upstreamed improvements to our dependency on create-react-app, reducing it by ~63%.

* You can now sync your Bare projects with your Expo config by re-running expo eject — we'll move to rename this command in upcoming versions.

* Improved support for Simulators, Emulators, and unauthorized Android devices:

![Terminal window showing an unauthorized device](https://dev-to-uploads.s3.amazonaws.com/i/b9ln3rg0gyil06ekxmj5.png) 

## 🍩 Snack improvements

As of December, Snack has a new home 🏡 at the [expo/snack monorepo](https://github.com/expo/snack). The monorepo will make it easier for developers to find documentation, contribute, and report bugs. This’ll be your place to go when you want to integrate Snack examples in your documentation. It currently contains the documentation and the snack-sdk package, and other packages such as the website and "snackager" (the Snack packager) will be moved there as well.

A new major version of the snack-sdk (v3) has been released to developers! It's faster, easier to use, comes with shiny new documentation and lots of tests. We've already battle-tested it on the [snack.expo.io](http://snack.expo.io) website and snack-sdk@3 is now available on the new expo/snack monorepo. It supports SDK 40 and has smart dependency management (similar to expo install) to help with selecting compatible package versions.

🏡 [Visit the new expo/snack monorepo](https://github.com/expo/snack).

### A note about missing dependencies on Snack

As of SDK 40, Snack requires that all used dependencies are added to package.json. This allows us to load a leaner runtime and provide faster and more accurate code completion. Any dependencies that are missing will be visible in the *Problems Panel* and can be added or updated using the provided action. Some of these missing dependencies already showed a warning in SDK 39, but will now result in an error as of SDK 40.

## 🏗 Deprecations, renamings, and removals

### LegacyNotifications has been removed in favor of expo-notifications

The legacy Notifications library (imported from the `expo` package) has been deprecated since SDK 38, and will be removed in SDK 41. If you're still relying on this package, you should upgrade to the [new expo-notifications library](https://docs.expo.io/versions/latest/sdk/notifications/), which has plenty of improvements and shiny new features!

### expo-random is now a peer dependency of expo-auth-session

Starting with SDK 40, when you install expo-auth-session you will also need to install expo-random.

If you use the latest version of expo-cli, `expo upgrade` will handle installing expo-random for you if your project includes expo-auth-session in its dependencies.

### `AppLoading` has been extracted from the expo package

If you use this component, you should run expo install expo-app-loading and import AppLoading from its own package: `import AppLoading from 'expo-app-loading';`. This is part of an ongoing effort to make the expo package as lightweight as possible.

### @react-native-community/picker is now @react-native-picker/picker

In September, the policy for the React Native Community organization was changed to focus on tooling and discussions to support the React Native ecosystem, and it is no longer is a host for libraries maintained by various React Native users ([learn more here](https://github.com/react-native-community/discussions-and-proposals/issues/176#issuecomment-693569246)). As a result, libraries that were once part of the React Native Community are now rebranding under their own namespaces. This is the first of those renames that has impacted the Expo SDK, but we expect there to be more in the future.

You can transition to the new package name by uninstalling @react-native-community/picker, then running `expo install @react-native-picker/picker` and updating all of your imports accordingly in your app code.

### Clipboard and CheckBox continue life in the Expo SDK

As React Native [continues to remove APIs in order to focus on its core functionality](https://github.com/react-native-community/discussions-and-proposals/issues/6), `Clipboard` and `CheckBox` have been deprecated and slated for removal in the upcoming React Native 0.64 release. You can switch over to expo-clipboard and expo-checkbox today in preparation for their removal. These APIs are almost identical, but there are some slight differences in order to have them fit in with the rest of the Expo SDK, so please refer to the [expo-clipboard](https://docs.expo.io/versions/v40.0.0/sdk/clipboard/) and [expo-checkbox](https://docs.expo.io/versions/v40.0.0/sdk/checkbox/) documentation when switching.

### Global APIs set by the expo package are now deprecated

Expo has historically exported several APIs on the global `__expo` and `Expo` objects in order to make it easier for libraries to interoperate between Expo's Managed environments and Bare React Native projects. This isn't necessary anymore, and we've deprecated these globals and slated them for removal in SDK 41. [Learn more on expo.fyi](https://expo.fyi/deprecated-globals).

## 👋 Dropping iOS 10 support in the near future

iOS 10 is the last version of iOS that still supports 32-bit simulator builds (x86), and to keep Expo npm packages smaller, we plan to publish only 64-bit pre-build binaries for simulators (x64 and arm64). This has been past due — the last time we dropped an iOS version was over two years ago, when we dropped support for iOS 9 in September 2018. Apple no longer reports usage statistics for iOS 10 directly, but you can get a rough idea from reading the [App Store — iOS and iPadOS usage table](https://developer.apple.com/support/app-store/) — 6% of all devices use iOS 11 or lower at the time of writing.

## 🧹 Dropped SDK 36; will drop SDK 37 next release

We routinely drop SDK versions that have low usage in order to reduce the number of versions we need to support. This release sees the end of life for SDK 36. As usual, your standalone apps built with SDK 36 will continue to work; however, SDK 36 projects will no longer work within the latest version of the Expo client. If you want to re-run expo build, then you’ll need to upgrade from SDK 36, preferably to SDK 40 so you won’t need to update again for a while (and also because each Expo version is better than the last!).

Our next release is planned for March 2021 and, at that time, we’ll be dropping support for SDK 37. If your project is running on SDK 37, consider upgrading to a newer version in the coming months.

## ➡️ Upgrading your app

### Managed workflow

Here’s how to upgrade your app to Expo SDK 40 from 39:

* Run `expo upgrade` in your project directory (requires the latest version of expo-cli, you can update with `npm i -g expo-cli`).

* If you use `metro.config.js` in your project, please ensure that you use `@expo/metro-config` instead of the `metro-config` package for getDefaultConfig. [Learn more](https://docs.expo.io/guides/customizing-metro/).

* If you are still using `react-navigation` v4 along with `react-native-screens`, please refer to [this comment](https://github.com/expo/expo/issues/11301) to handle upgrade warnings.

* Refer to the “Deprecations, renamings, and removals” section above for breaking changes that are most likely to impact your app.

* Make sure to check the [changelog](https://github.com/expo/expo/blob/master/CHANGELOG.md) for all other breaking changes!

* Update the Expo app on your phones from the App Store / Google Play. expo-cli will automatically update your apps in simulators if you delete the existing apps, or you can run `expo client:install:ios` and `expo client:install:android`.

* If you built a standalone app previously, [remember](https://docs.expo.io/versions/latest/workflow/publishing/#limitations) that you’ll need to create a new build in order to update the SDK version. Run `expo build:ios` and/or `expo build:android` when you are ready to do a new build for submission to stores.

### Bare workflow

The Bare workflow lets you operate independently of the Expo SDK cycle, updating RN versions and versions of individual Expo packages however and whenever you want. However, if you *do* stick roughly to Expo SDK versions, these steps will help you to upgrade to Expo SDK 40 from 39:

* Install the latest version of CocoaPods — **1.10.0 or greater is required.**

* Run `expo upgrade` in your project directory (requires the latest version of expo-cli; you can update with `npm i -g expo-cli`).

* No additional upgrade steps are required to use react-native 0.63.4 from 0.63.3. (See the [React Native upgrade helper](https://react-native-community.github.io/upgrade-helper/?from=0.63.3&to=0.63.4) for more detail.)

* Rebuild your native projects with `yarn ios` and `yarn android`.

* Make sure to check the [changelog](https://github.com/expo/expo/blob/master/CHANGELOG.md) for other breaking changes!