Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The method or property expo-crypto.getRandomBytes is not available on android, are you sure you've linked all the native dependencies properly? #28432

Closed
junaidsarwarred opened this issue Apr 24, 2024 · 2 comments
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues

Comments

@junaidsarwarred
Copy link

Minimal reproducible example

Use expo-auth-session AuthSession.makeRedirectUri

What platform(s) does this occur on?

Android

Did you reproduce this issue in a development build?

Yes

Summary

I have upgraded my react native project to expo 50 and after fixing all of the issues I am stuck on this issue which appears on the emulator after app building and bundling. After some investigation I found expo-crypto is a peer-dependency of expo-auth-session and I have used expo-auth-session in my project.

Environment

npx expo-env-info

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.3
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
Watchman: 2024.03.18.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11076708
Xcode: 15.3/15E204a - /usr/bin/xcodebuild
npmPackages:
@expo/metro-config: ~0.17.1 => 0.17.7
expo: ~50.0.17 => 50.0.17
react: 18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
react-native-web: ~0.19.6 => 0.19.11
npmGlobalPackages:
eas-cli: 7.6.1
Expo Workflow: bare

Expo Doctor Diagnostics

npx expo-doctor@latest
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check for issues with metro config
✔ Check native tooling versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK

@junaidsarwarred junaidsarwarred added the needs validation Issue needs to be validated label Apr 24, 2024
@expo-bot expo-bot added incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues and removed needs validation Issue needs to be validated labels Apr 24, 2024
@expo-bot
Copy link
Collaborator

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@jacobo-jaramillo
Copy link

I'm having this exact same issue expo-random.getRandomBytes is not available on android and it's happening on the screen where I'm using expo-auth-session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues
Projects
None yet
Development

No branches or pull requests

3 participants