Skip to content

Instantly share code, notes, and snippets.

@mjhassan
Last active May 23, 2019 06:35
Show Gist options
  • Select an option

  • Save mjhassan/9674e0faf5b9316d1bd42f7ac7714022 to your computer and use it in GitHub Desktop.

Select an option

Save mjhassan/9674e0faf5b9316d1bd42f7ac7714022 to your computer and use it in GitHub Desktop.
React Native issues and solution

"No bundle url present” Error

  • Open a terminal window
  • cd into YOUR_PROJECT/ios
  • Remove the build folder with rm -r build
  • Run react-native run-ios again

Alternatively, run

rm -rf ios/build/; kill $(lsof -t -i:8081); react-native run-ios --configuration Release --device "___your_device_name___"

for Android

rm -rf android/build/; kill $(lsof -t -i:8081); react-native run-android

Could not debug. Error while executing command 'adb devices': Command failed: adb devices /bin/sh: adb: command not found

Create android/local.properties file with ndk.dir and sdk.dir path. e.g. ndk.dir=/Users/jahid.hassan/Library/Android/sdk/ndk-bundle sdk.dir=/Users/jahid.hassan/Library/Android/sdk

AdNetwork not found

$(PROJECT_DIR)/../../../../ios/Frameworks

The SDK Build Tools revision (23.0.1) is too low for project ':react-native-sms-android'. Minimum required is 25.0.0

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 26
                buildToolsVersion '26.0.3'
            }
        }
    }
}

Error: ENFILE: file table overflow

echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536

Unrecognized font family 'Ionicons' Try any/all of the followings:

  • You have restart packager after adding fonts. Close the packager terminal and restart from xcode. Should fix your problem.
  • npm link react-native-vector-icons or react-native link react-native-vector-icons

iOS release build

react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios

Hide navigation bar

export const AppNavigator = StackNavigator({
  Splash: {
  	screen: SplashScreen 
  },
  Login: { 
  	screen: LoginScreen 
  },
},{ 
    headerMode: 'none' 
  })

or header null for specific screen

export const AppNavigator = StackNavigator({
   Splash: { 
   	screen: SplashScreen, 
    navigationOptions: { 
    	header: null 
    }
  },
   Login: { 
   	screen: LoginScreen,
    navigationOptions: { 
    	title: 'Login' 
    }
  },
},{ })

Change status bar color

<StatusBar backgroundColor='blue' barStyle='light-content' />

'FBSDKCoreKit/FBSDKCoreKit.h' file not found

${PODS_ROOT}/Headers/Public/FBSDKCoreKit

Upgrate react native

$ npm install -g react-native-git-upgrade
$ react-native-git-upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment