Cannot get react-native metamask boilerplate project to work

I’ve spent several days trying to get the boilerplate project to work on my system to no avail. I am fairly new to React Native.

Repro steps:

  1. Download the project from the MetaMask react-native page (Sorry, I cannot include links but see the screenshot below).
  2. Run yarn setup as instructed.

If I run npm start I get to this page but nothing happens. I have tried pressing both ‘R’ to reload and ‘D’ for developer options but both just yield:

“No apps connected. Sending “reload” to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.”

I am reading that npm start actually does not launch the app and you need to specify yarn ios or yarn android instead. However I am leaving this here just in case I am missing something.

I tried to run with yarn ios but it appears that by default the package.json wants to launch iPhone 11 which fails immediately since the latest version of Xcode does not include the iPhone 11 simulator. I tried to switch the line within package.json to iPhone 14 and a new error presents itself:

Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNativeApp.xcworkspace.

From a quick google search this error can occur if cocoapods is not installed. It requires you to change directory into the ios folder, run pod install and relaunch the application. After running pod install and trying yarn ios now a new error log generates (I have attached the error logs as a separate comment below).

I’ve also tried to do a step-by-step installation of the MetaMask-sdk for react-native outlined in the same section from #1 above but an error with shim.js occurs.

I’m at a loss here. I’ve tried to utilize WalletConnect’s new Web3Modal for react-native and although it seems to work, it excludes MetaMask! So that is not a viable option.

Has anyone had any luck setting up the boilerplate or a project with react-native and MetaMask recently? Deeplinking is not an option because I need to create this within react-native as it will be a native iOS application. Any help or guidance is greatly appreciated.

Here is another screenshot of where you can download the react-native starter project.

Regarding the error log after running pod install with the ios directly and at the root running yarn ios:

warning: Run script build phase ‘Start Packager’ will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking “Based on dependency analysis” in the script phase. (in target ‘reactNativeApp’ from project ‘reactNativeApp’)
warning: Run script build phase ‘Bundle React Native code and images’ will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking “Based on dependency analysis” in the script phase. (in target ‘reactNativeApp’ from project ‘reactNativeApp’)

2023-04-20 17:59:54.768 xcodebuild[9859:69982] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
— xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:D44FFF77-759E-4C93-9DB5-6B12D7D2DB39, OS:16.4, name:iPhone 14 }
{ platform:iOS Simulator, id:D44FFF77-759E-4C93-9DB5-6B12D7D2DB39, OS:16.4, name:iPhone 14 }
** BUILD FAILED **

The following build commands failed:
CompileC /Users/benjaminkang/Library/Developer/Xcode/DerivedData/reactNativeApp-aftxworcnwxuqnckadyscgqgdbik/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Yoga.build/Objects-normal/arm64/Yoga.o /Users/benjaminkang/Documents/season-3/reactNativeApp/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target ‘Yoga’ from project ‘Pods’)
(1 failure)

There is a ton of comments prior to this message above. Perhaps this is a arm64 specific problem? I am on a M2 Macbook Air laptop.

I can confirm this issue still occurs when running on my Intel chip Macbook Pro so it is not unique to just ARM64/M2/M1 Apple chip computers.

Hi @benjaminkang ,

We have a team looking into this. Will circle back and respond to you soon.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.