Preparing a medium size production level app for IOS.
App uses a lot of native capabilities and and some point of attempting to integrate some of them I moved to using Cocoapods.manually using a Podfile file.
This helped me to over come all the build fails and could finally get the RN app running.
Only now, getting a very vague error:
Unhandled JS Exception: Native module cannot be nullHaving a hard time to figure out which 3rd party package is causing this..a bunch of git issues are pointing to add the right package to Podfile file and pod install which I did, but still not joy.
Those are the `git issues, most of them in a specific package:
- SO answers for 'react-native-push-notification'
- Git issue in 'react-native-tab-view'
- Git issue in 'react-native-push-notification'
- Git issue in 'react-native-vector-icons'
- Git issue solution
Most of those pretty much solve this the same way by adding to Podfile file the right pod link and running pod install - this did not worked for me
Things that I've tried:
- Removing binary links but
JavaScriptCore.frameworkandlibPods-myProjectName.a - Clearing
Librariesfrom all.xcodeprojpackages to resolve duplicated linking - Cleaned project rebuilt, cleared packages with
pod deintegrateand reinstalled.. basically cleared and reinstalled everything I could - Upgrade
react-nativefrom0.58.6to0.59.9
Followed this blog post to convert my existing project to use Cocoapods`
Pod install seems pass without any errors - pod install output:
Analyzing dependenciesFetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`Downloading dependenciesInstalling AppAuth (1.3.0)Installing BugsnagReactNative (2.23.1)Installing DoubleConversion (1.1.6)Installing Folly (2018.10.22.00)Installing RNDeviceInfo (2.3.2)Installing RNGestureHandler (1.1.0)Installing RNSVG (9.5.1)Installing RNShare (3.0.0)Installing RNSound (0.11.0)Installing RNVectorIcons (6.6.0)Installing React (0.59.9)Installing ReactNativePermissions (1.1.1)Installing boost-for-react-native (1.63.0)Installing glog (0.3.5)Installing react-native-camera (2.1.1)Installing react-native-image-picker (0.28.1)Installing react-native-image-resizer (1.2.0)Installing react-native-keep-awake (4.0.0)Installing react-native-netinfo (3.2.1)Installing react-native-orientation (3.1.3)Installing react-native-view-shot (3.1.2)Installing react-native-webview (5.7.0)Installing yoga (0.59.9.React)Installing ReactNativeNFC (1.0.0)Generating Pods projectIntegrating client projectPod installation complete! There are 31 dependencies from the Podfile and 23 total pods installed.And the Podfile:
source 'https://github.com/CocoaPods/Specs.git'platform :ios, '9.0'target 'myProjectName' do pod 'React', :path => '../node_modules/react-native', :subspecs => ['Core','CxxBridge','DevSupport','RCTText','RCTImage','RCTNetwork','RCTWebSocket','RCTSettings','RCTAnimation','RCTLinkingIOS', # Add any other subspecs you want to use in your project # Remove any subspecs you don't want to use in your project ] pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga" pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' pod 'react-native-webview', :path => '../node_modules/react-native-webview' pod 'RNSound', :path => '../node_modules/react-native-sound' pod 'react-native-camera', :path => '../node_modules/react-native-camera' pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info' pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler' pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker' pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer' pod 'react-native-keep-awake', :path => '../node_modules/react-native-keep-awake' pod 'react-native-orientation', :path => '../node_modules/react-native-orientation' # permissions_path = '../node_modules/react-native-permissions/ios' # pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec" pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions' pod 'RNShare', :path => '../node_modules/react-native-share' pod 'RNSVG', :path => '../node_modules/react-native-svg' pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' pod 'react-native-view-shot', :path => '../node_modules/react-native-view-shot' pod 'AppAuth' pod 'BugsnagReactNative', :path => '../node_modules/bugsnag-react-native' pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo' pod 'ReactNativeNFC', :path => '../node_modules/react-native-rfid-nfc-scanner/ios'endAnd my dependancies inside package.json:
"dependencies": {"@react-native-community/netinfo": "3.2.1","axios": "0.18.0","bugsnag-react-native": "2.23.1","country-list": "2.1.1","formik": "1.5.1","link": "^0.1.5","moment": "2.24.0","react": "16.6.3","react-native": "0.59.9","react-native-android-location-enabler": "^1.1.0","react-native-android-wifi": "0.0.41","react-native-app-auth": "^4.4.0","react-native-camera": "2.1.1","react-native-collapsible": "1.4.0","react-native-country-picker-modal": "0.7.1","react-native-device-info": "2.3.2","react-native-fs": "^2.16.4","react-native-gesture-handler": "1.1.0","react-native-image-picker": "0.28.1","react-native-image-resizer": "^1.2.0","react-native-keep-awake": "^4.0.0","react-native-linear-gradient": "2.5.4","react-native-orientation": "3.1.3","react-native-permissions": "1.1.1","react-native-pinch-zoom-responder": "^0.1.2","react-native-qrcode-scanner": "1.1.2","react-native-rfid-nfc-scanner": "github:avshalomp/react-native-rfid-nfc#fix/nfc_infrastructure","react-native-share": "^3.0.0","react-native-smooth-pincode-input": "1.0.3","react-native-sound": "^0.11.0","react-native-status-bar-height": "2.3.1","react-native-svg": "9.5.1","react-native-svg-charts": "5.2.0","react-native-swipe-gestures": "1.0.3","react-native-swiper": "^1.5.14","react-native-vector-icons": "6.6.0","react-native-view-shot": "^3.1.2","react-native-webview": "^5.7.0","react-native-wifi": "1.0.1","react-navigation": "3.3.2","react-navigation-transitions": "1.0.10","react-redux": "6.0.1","redux": "4.0.1","redux-persist": "5.10.0","redux-saga": "1.0.2","reselect": "4.0.0","styled-components": "4.1.3","yup": "0.26.10" }My current env:
React: 16.6.3, React Native: 0.59.9 // tested with React Native 0.58.6 too Xcode: 11.4.1Really having hard time to debug this one as React Native errors are not so helpful, plus probably missing something
Any Ideas how to get more info about this one?
Or how to solve it?
Help..