metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

Cannot run code base locally on an Android simulator or phone

Open Karan-U-Kanthawar opened this issue 3 years ago • 5 comments

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

Karan-U-Kanthawar avatar Feb 23 '22 02:02 Karan-U-Kanthawar

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

changlizhi avatar Feb 28 '22 06:02 changlizhi

I resolved It when I use the 0.66.3 branch of https://github.com/facebook/react-native

changlizhi avatar Feb 28 '22 06:02 changlizhi

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. image

Karan-U-Kanthawar avatar Mar 07 '22 04:03 Karan-U-Kanthawar

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.

DiegoCortezLFL avatar Jul 14 '22 17:07 DiegoCortezLFL

I have the same problem.

buynao avatar Aug 05 '22 10:08 buynao

I have the same problem too.

MiryangJung avatar Nov 29 '22 08:11 MiryangJung

I have the same problem when i use ubuntu

ink-paint avatar Dec 09 '22 08:12 ink-paint

I had the same problem on my m1 macbook, and I solved it by modifying the ruby version. image

ihj0906 avatar Jan 27 '23 01:01 ihj0906

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```

caotin avatar Mar 20 '23 07:03 caotin