expo: Permissions not working in standalone iOS build

🐛 Bug Report

Permissions methods (getAsync and askAsyc) not working in standalone iOS build. The app does not pop up dialogs for permissions and proceeds without crashing. The errors are caught in Sentry. It happens at app/node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.js in call at line 15:42 for both.

An exception was thrown while calling ExpoPermissions.getAsync with arguments ( notifications ): -[__NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x2834bddc0

An exception was thrown while calling ExpoPermissions.askAsync with arguments ( location ): -[NSTaggedPointerString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0xfb559f5ff99f56ca

Environment

Expo CLI 3.11.2 environment info: System: OS: macOS 10.14.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.5.0 - ~/.nvm/versions/node/v8.12.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 11.3/11C29 - /usr/bin/xcodebuild npmPackages: expo: ^36.0.0 => 36.0.2 react: 16.9.0 => 16.9.0 react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4 react-navigation: 4.0.10 => 4.0.10 npmGlobalPackages: expo-cli: 3.11.2

iOS Standalone

Steps to Reproduce

This happened on iPhone 6 with iOS 12.4.4 (oh yeah, the iOS updated the night before)

Expected Behavior

On new install, it should ask for permissions when opening the app.

Actual Behavior

It is not asking for permissions.

Reproducible Demo

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

@chris-ryu I was able to solve it by doing the following:

  • Rely on expo-permissions: "^7.0.0" in package.json instead of “latest”
  • Run expo r -c to force expo rebuild

Can you explain how you fixed this? I am having the same issue. I am getting the following error: Error: An exception was thrown while calling ExpoPermissions.getAsnyc with arguments (location) : [NSTaggedPointerString countByEnumeratingWithState:objects:count:]:unrecognized selector sent to instance

I looked at my app.json file and my SDK version is 35.0.0. I am currently using Expo: ^36.0.1

I tried manually changing my app.json SDK version to 36.0.0 but my app crashed. I got the console.error: “React Native version mismatch”.

My app works perfectly on android devices but for some reason my iphone 10 wont render my screen due to the following code line not working:

import * as Permissions from “expo-permissions”;

getPermission = async () => { const {status} = await Permissions.getAsync(Permissions.LOCATION); //Other code }

The error occurs when I try to open my real iphone device in production Mode with LAN connection using the EXPO app. I use the camera app to scan the QR code which takes me to the EXPO app to generate the app. The app generates as intended and when I get to the main screen that calls the Permission function above, it throws the error I stated.

I’m using 35.0.0, iPhone Xs.

const { status: existingStatus } = await Permissions.getAsync( Permissions.NOTIFICATIONS );

An exception was thrown while calling ‘ExpoPermissions.getAsync’ with arguments ‘(notifications)’:-[_NSCFString countByEnumerationWithState:objects:count:]:unrecognized selector sent to instance…