Expo dependency error, "Cannot find native module 'ExpoCrypto'", in Non-Expo React Native Projects
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- react-native, typescript
- Área
- mobile
Línea de trabajo
Reproduce el fallo con React Native 0.73.2, cloudinary-react-native 0.2.0 y la configuración de bare project descrita en el issue. Inspecciona primero package-lock.json y las dependencias relacionadas con Expo del paquete; el trabajo estará terminado cuando el SDK funcione en una aplicación React Native bare o documente el workaround necesario y la configuración compatible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I encountered an issue while integrating the cloudinary-react-native package version 0.2.0 into my bare React Native project. The problem arises due to the package's dependency on ExpoCrypto and other Expo modules, which are not available in a non-Expo (bare) React Native environment.
Steps to Reproduce
- Create a new bare React Native project using npx react-native init MyProject.
- Install the cloudinary-react-native package using npm install cloudinary-react-native.
- Attempt to use the package according to the provided documentation.
- Encounter an error related to the missing ExpoCrypto module when running the app.
Expected Behavior
I expected that the cloudinary-react-native package could be used in a bare React Native project without dependencies on Expo-specific modules, or that there would be clear documentation on how to handle such dependencies in a non-Expo environment.
import {Cloudinary} from '@cloudinary/url-gen';
import {upload} from 'cloudinary-react-native';
async function uploadImageToCloudinarySDK(payload: any) {
const {folder, upload_preset, uri} = payload;
const cld = new Cloudinary({
cloud: {cloudName: Config.CLOUDINARY_CLOUD_NAME },
url: {secure: true},
});
const options = {folder, upload_preset, unsigned: true};
await upload(cld, {
file: uri,
options,
callback: (error: any, response: any) => {
if (error) {
console.error('Upload Error:', error);
} else {
console.log('Upload Successful:', response);
}
},
}).catch((error: any) => console.log('ERROR CLD UPLOAD', error?.message));
}
Actual Behavior
The application throws an error indicating that the ExpoCrypto native module cannot be found. This suggests that the package relies on Expo modules, which are not present in bare React Native environments. The exact error message is:
Cannot find native module 'ExpoCrypto', js engine: hermes
Environment
- React Native version: 0.73.2
- Cloudinary React Native SDK version: 0.2.0
- Operating System: iOS
- Device details: iPhone 15 Pro Max
Additional Context
I am not using Expo in my project and prefer to keep it as a bare React Native application. I noticed that the package-lock.json file lists several Expo-related dependencies, which might be causing this issue.
Given the package's potential utility for React Native developers looking to integrate Cloudinary, finding a solution to make it compatible with both Expo and non-Expo environments would be greatly beneficial.
Potential Solutions or Workarounds
I am seeking guidance on how to resolve this issue. Possible solutions could include:
- Instructions on how to remove or bypass the Expo dependencies in a non-Expo environment.
- Updates to the package to support bare React Native projects without requiring Expo modules.
- Any other recommended approaches for using cloudinary-react-native in non-Expo React Native projects.
Thank you for looking into this issue. I appreciate any feedback or solutions you can provide.
- Lenguaje dominante
- TypeScript
- Estrellas
- 28
- Forks
- 21
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudinary/cloudinary-react-native
-
hacktoberfest-accepted
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
cloudinary/cloudinary-react-native#55 · 3 comentarios ·
-
Add CODE_OF_CONDUCT.mdQuizá libre de nuevo @adimiz1 la tomó hace 405 días y no hay ningún pull request abierto. Abierto
cloudinary/cloudinary-react-native#53 · 2 comentarios · 1 asignado ·
-
Support for expo 54Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
cloudinary/cloudinary-react-native#52 · 8 comentarios ·
-
Issue: Improve `bootstrap.js` to support both Yarn and NPM with clearer errorsPosiblemente ocupada @adimiz1 la tomó hace 415 días. Abierto
cloudinary/cloudinary-react-native#50 · 3 comentarios · 1 asignado ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
Todos los issues de cloudinary/cloudinary-react-native
Issues similares
-
area:docs documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 12 días
-
area:docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
thainanluiz/TSSuper#30 ·
-
[analytics-core] getQueryParams does not decode `+` as space and truncates values containing `=`Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
amplitude/Amplitude-TypeScript#2179 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
ci good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
TMHSDigital/GH-Arcade#111 ·