Could someone help me, I’m on IOS 15.2 (simulator) and when requesting the MEDIA_LIBRARY permission it returns [granted] however when I use expo-media-library it returns the following error:
Error: MEDIA_LIBRARY permission is required to do this operation.
Hey @cerivera, the Permissions module has been removed in favor of each module having it’s own permission methods. Please use either the hook or get/request methods found here MediaLibrary - Expo Documentation
Thanks for answering, I have tried with
onst status = await MediaLibrary.requestPermissionsAsync();
but it sends me this message all the time [Error: Permissions module not found. Are you sure that Expo modules are properly linked?]
My code is:
const { status } = await MediaLibrary.requestPermissionsAsync();
and response:
Error: Permissions module not found. Are you sure that Expo modules are properly linked?
If you run expo doctor you will see that you should be using an older version of expo-media-library with Expo SDK 41.
$ expo doctor
Some dependencies are incompatible with the installed expo package version:
- expo-media-library - expected version: ~12.0.2 - actual version installed: 12.1.2
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
or install individual packages by running expo install [package-name ...]
Try fixing this (e.g. by running expo doctor --fix-dependencies) and see if it fixes your problem.
So you’ve ejected to the Bare workflow?
I am not 100% sure how config plugins work if you’ve ejected. Maybe running expo prebuild --clean will help, but I’m not really sure. If you want to work in the Bare workflow, make sure you have your android and ios directories committed to Git before you try something like expo prebuild --clean in case you need to revert.
EDIT: expo prebuild --clean does seem to be the way to regenerate the native files, if that’s what you want to do.
I think you should try running expo doctor --fix-dependencies anyway, regardless of whether you’re on the Managed or Bare workflow.
You are amazing , I managed to solve the problem with
[expo doctor --fix-dependencies] without having to run [expo prebuild --clean] since this would cause the IOS and ANDROID folders to be deleted, which is not good for my project, since I have created native modules [JAVA AND SWIFT].
The problem was had on IOS but now it works on both platforms.
I greatly appreciate the help given.
IMPORTANT NOTE: in case someone, update to version expo 41.0.1 and use [expo doctor --fix-dependencies] library [expo-camera: 11.0.2] has a conflict with library [expo-contacts:9.1.2] causing the following error [expo-contacts error: package org.jetbrains.annotations does not exist] for now leave the version [expo-camera: 9.1.0] as the error is possibly fixed in the following versions of [expo 42, 43 , 44]
Another error [ANDROID] that was generated as a result of the update was:
[FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ‘:app:processDebugResources’.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
//android/app/build/intermediates/packaged_manifests/debug/AndroidManifest.xml:184: AAPT: error: resource style/DeviceCredentialHandlerTheme (aka com.cer:style/DeviceCredentialHandlerTheme) not found.]
The solution to the error is found in the following link:
[Solution Here]