Expo SDK 34 - Permissions.getAsync undefined error

Hi all,

After updating my app to SDK 34 (from SDK 33) I’am experiencing an error in Testflight with Permissions.getAsync. The weird part is that it is working fine when running the app in the simulator. I’am using Sentry to log exceptions and the following message is logged when Permissions.getAsync is triggered:

TypeError: undefined is not an object (evaluating 'p.Permissions.getAsync')

The actual code isn’t changed after SDK 33:

import * as Permissions from 'expo-permissions';

return Permissions.getAsync(Permissions.NOTIFICATIONS)

Don’t know if it is a bug or something I did wrong. Hope someone can help me!

Can you run this locally in production with expo start --no-dev --minify and see if the same error pops up?

Also, go ahead and share your package.json

No error pops up when I run it locally with expo start --no-dev --minify

  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start"
  "dependencies": {
    "axios": "^0.19.0",
    "expo": "^34.0.3",
    "expo-asset": "^6.0.0",
    "expo-constants": "^6.0.0",
    "expo-font": "^6.0.1",
    "expo-localization": "^6.0.0",
    "expo-permissions": "^6.0.0",
    "expo-web-browser": "^6.0.0",
    "i18n-js": "^3.3.0",
    "lodash.clonedeep": "^4.5.0",
    "lodash.merge": "^4.6.2",
    "prop-types": "^15.7.2",
    "pusher-js": "^4.4.0",
    "react": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
    "react-native-circular-progress": "0.2.0",
    "react-native-datepicker": "^1.7.2",
    "react-native-elements": "^1.1.0",
    "react-native-extended-stylesheet": "^0.12.0",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-reanimated": "^1.1.0",
    "react-navigation": "^3.11.1",
    "react-redux": "^7.1.0",
    "redux": "^4.0.4",
    "redux-thunk": "^2.3.0",
    "sentry-expo": "^1.13.0"
  "devDependencies": {
    "babel-preset-expo": "^5.2.0"

Just tested it in the Expo client on my iPhone, same error as in Testflight. Same result when running it with both expo start -c as with expo start --no-dev --minify

Just tried this myself, seems like expo-permissions works fine. Could you try clearing node_modules and reinstalling?

Sorry, wasn’t fully awake I think. Forgotten to update another Permissions import :man_facepalming:
Now working as expected!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.