Closed thebiltheory closed 2 months ago
For what it's worth. It is also crashing when using requestPermissionsAsync
from Audio
.
import { Audio } from "expo-av";
...
useEffect(() => {
async function requestPermissions() {
console.log("⁉️ Requesting permissions");
const result = await Audio.requestPermissionsAsync();
console.log("Request permissions result", result);
if (!result.granted) {
console.warn("Permissions not granted", result);
return;
}
}
requestPermissions();
}, []);
Hey @thebiltheory!, here's a few things you might want to check:
npx expo run:android
or npx expo run:ios
). As this package contains native Swift & Kotlin code, you'll need to run this once so that the app is bundled with the native code.If those don't work, could you provide me the following:
requestPermissionsAsync()
in a try/catch, and then console.log the error, and paste it hereHey @jamsch, Thanks for the fast response!!
expo run:ios
expo
as a dependency.Wrapping it in a try/catch
doesn't work. The app closes immediately. It's really hard to tell what causes the issue.
I'm running ios 18 tho.
EDIT: Ran an iPhone 16 simulator with ios18
[TCC] This app has crashed because it attempted to access
privacy-sensitive data without a usage description. The app's
Info.plist must contain an NSMicrophoneUsageDescription key with
a string value explaining to the user how the app uses this
data.
@thebiltheory That looks like the app wasn't built with the config plugin. Have you added that in to your app.json? You can copy the contents from the installation step 2 on the readme. It's also likely why expo-av wasn't working for you either. You also may need to run a fresh prebuild (npx expo prebuild --clean
) to regenerate the android/iOS folders with the config from app.json.
@jamsch I did! I have also prebuild the app many times
It was working with ios17 tho.
@thebiltheory Very strange. Just to confirm when you run the prebuild, does your app include the permissions in ios/[app_name]/Info.plist
? (also small nit: you've got expo-asset
there twice)
I feel stup*d.😂 Removing expo-asset
did the trick!
Thanks for being my rubber duck @jamsch.
Take aways:
Also. Thank you for this library.
Fixed.
Perhaps I'm doing something wrong but I made sure to follow the doc.
The app crashes on a physical device every time I run
requestPermissionsAsync
.Here is a simple implementation of a screen. I stripped everything from the screen to isolate the issue.
Permissions are also well configured in
app.json
.Am I missing something?