metamask-mobile
metamask-mobile copied to clipboard
Cannot run code base locally on an Android simulator or phone
I tried to run metamask-mobile locally on my android device / android simulator but failed to do so.
After cloning the code-base I used the command npx react-native run-android -- --warning-mode=all
to run & got this error message:
What went wrong: Included build ‘C:\Users\Path\metamask-mobile\node_modules\react-native\packages\react-native-codegen\android’ does not exist.
I looked around but could not find any solution that worked. can you please tell me how to fix this or let me know the steps to launch it locally on android after cloning the repo?
I used npx react-native run-android -- --warning-mode=all
instead of yarn start:android
after cloning because I got an error message saying
bash: react-native: command not found
I got the same error!
When I try to use the origin https://github.com/facebook/react-native
I found the react-native-codegen
in packages
but the android
dir is still not found
I resolved It when I use the 0.66.3 branch of https://github.com/facebook/react-native
I tried building it from source as you said but I faced another error like this:
- What went wrong: A problem occurred evaluating project ':ReactAndroid'. Could not get unknown property 'ANDROID_NDK_VERSION' for extension 'android' of type com.android.build.gradle.LibraryExtension.
Later I read the README again & found out this codebase can't be run locally on a Windows machine.
Were you able to fix this issue? I'm trying to run locally using a Mac but still getting Included build '.../metamask-mobile/node_modules/react-native/packages/react-native-codegen/android' does not exist.
I have the same problem.
I have the same problem too.
I have the same problem when i use ubuntu
I had the same problem on my m1 macbook, and I solved it by modifying the ruby version.
You can try this
yarn setup
It will run this file ./scripts/postinstall.sh
If this script isn't working you can run this
REACT_NATIVE_VERSION="0.66.0"
rm -rf node_modules/react-native/packages
mkdir -p node_modules/react-native/packages && cd node_modules/react-native/packages
curl --proto '=https' --tlsv1.2 -LJO https://github.com/facebook/react-native/archive/refs/tags/v${REACT_NATIVE_VERSION}.tar.gz
tar -zxvf react-native-${REACT_NATIVE_VERSION}.tar.gz react-native-${REACT_NATIVE_VERSION}/packages/react-native-codegen/
mv react-native-0.66.0/packages/react-native-codegen/ .
rm react-native-${REACT_NATIVE_VERSION}.tar.gz```