Skip to content

Instantly share code, notes, and snippets.

@AlexBrasileiro
Last active July 2, 2019 18:09
Show Gist options
  • Save AlexBrasileiro/d26bdb23b974e4766cb7e59be1d2ac13 to your computer and use it in GitHub Desktop.
Save AlexBrasileiro/d26bdb23b974e4766cb7e59be1d2ac13 to your computer and use it in GitHub Desktop.
React Native TIPS && BUGS

Run multiples projects with metro

react-native run-ios --port 8082 facebook/react-native#10715 (comment)

path.hub.getScope is not a function

  1. On ./node_modules/metro -> delete the folder node_modules
  2. On package.json (on metro folder) -> change "@babel/core": "7.0.0-beta.56" for "@babel/core": "7.0.0"
  3. npm install (on metro folder)
  4. On projectFolder -> rm -f .git/index.lock

React Native Clear Cache

  1. watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
  2. node node_modules/react-native/local-cli/cli.js start --reset-cache

Watchman Clear

  1. watchman watch-del-all
  2. watchman shutdown-server
  3. rm -rf /usr/local/var/run/watchman/root-state

iOS ld: library not found for -libName clang: error: linker command failed with exit code 1 (use -v to see invocation)

Select your Target, go to "Build Phases" in "Link Binary With Libraries" remove ".a" file of that library. Clean and Build.

xCode Problems

echo "Cleaning up node modules";

rm -rf node_modules;

npm install;

echo "Clearning all temp directories";

rm -rf $TMPDIR/react-native-packager-cache-*;

rm -rf $TMPDIR/metro-*;

rm -rf $TMPDIR/react-*;

rm -rf $TMPDIR/haste-*;

watchman watch-del-all;

echo "Cleaning up iOS folders" cd ios;

rm -rf Pods;

rm -rf Podfile.lock;

rm -rf build;

pod install;

cd ..;

echo "cleanup android folder" cd android;

rm -rf build;

echo "PLEASE DELETE THE APP AND RESTART SIMULATOR after cache is reset";

cd ..;

npm start -- --reset-cache;

Multiple commands produce 'Target 'RNFirebase' has a command with output libRNFirebase.a'

You can try to change the build system to Legacy,

File > Workspace Settings > Build System > Legacy Build System.

Get someProp + allProps

({ someProp, ...props })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment