npm install
- react-native link react-native-gesture-handler
- react-native link rn-splash-screen
- react-native link react-native-linear-gradient
- react-native link react-native-static-server && react-native link react-native-webview && react-native link react-native-zip-archive && RNFB_ANDROID_PERMISSIONS=true react-native link rn-fetch-blob && react-native link react-native-orientation
- react-native link react-native-dialogs
- react-native link react-native-vector-icons
- RNFB_ANDROID_PERMISSIONS=true react-native link react-native-fetch-blob
lsof -ti :8081 | xargs kill -9 npm start -- --reset-cache
react-native run-ios
react-native run-android
./gradlew assembleRelease
On node_modules/react-native/react.grandle
Place this code where doFirst{} method is
doLast { def moveFunc = { resSuffix -> File originalDir = file("$buildDir/generated/res/react/release/drawable-${resSuffix}"); if (originalDir.exists()) { File destDir = file("$buildDir/../src/main/res/drawable-${resSuffix}"); ant.move(file: originalDir, tofile: destDir); } } moveFunc.curry("ldpi").call() moveFunc.curry("mdpi").call() moveFunc.curry("hdpi").call() moveFunc.curry("xhdpi").call() moveFunc.curry("xxhdpi").call() moveFunc.curry("xxxhdpi").call() }
- No bundle URL present.
Run:
rm -rf ios/build/; lsof -ti :8081 | xargs kill -9; react-native run-ios
- React Native Settings
Go to react-native-settings under node_modules folder, and change its .JSX extensions to .JS
I recommend generator-rn-toolbox for applying launch screen or main icon using on react-native. It is more simple and easy to use through cli as react-native.
- Do not need to open XCode.
- Do not need to make a lot of image files for various resolutions.
- Anytime change launch screen using one line commend.
- node >= 6
- One square image or psd file with a size of more than 2208x2208 px resolution for a launch screen(splash screen)
- Positive mind ;)
- Install generator-rn-toolbox and yo
npm install -g yo
- Install imagemagick
brew install imagemagick
- Apply splash screen on iOS
yo rn-toolbox:assets --splash YOURIMAGE.png --ios
or Android
yo rn-toolbox:assets --splash YOURIMAGE.png --android
That's all. :)
- react-native run-ios --configuration Release --device "Matías’s iPhone"
Go to XCode -> Products -> Scheme -> Edit Scheme On Build Configuration, change Debug to Release
-
DEX Error on Compile Go to android/build.gradle
On defaultConfig {} (where is the targetSdk, compileSdk, etc.), place this line:
multiDexEnabled = true
-
Deploy to phone adb install -r ./android/app/build/outputs/apk/release/app-release.apk