voximplant / react-native-voximplant

Voximplant mobile SDK for React Native (iOS/Android)
http://voximplant.com
205 stars 39 forks source link

Native Module cannot be null #83

Closed leon2835 closed 5 years ago

leon2835 commented 5 years ago

Hi @YuliaGrigorieva

After i do all the steps that you mentioned from #42 & #72 After i delete all the library. I'm still unable to build it.

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Monkeys' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

 pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',
    'RCTAnimation'
  ]
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # Pods for Monkeys
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

  pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'

  pod 'react-native-voximplant', path: "../node_modules/react-native-voximplant'

  target 'MonkeysTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'Monkeys-tvOS' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Monkeys-tvOS

  target 'Monkeys-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Package.json

{
  "name": "Monkeys",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "postinstall": "sed -i '' 's/#import <RCTAnimation\\/RCTValueAnimatedNode.h>/#import <React\\/RCTValueAnimatedNode.h>/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h; sed -i '' 's/#import <fishhook\\/fishhook.h>/#import <React\\/fishhook.h>/' ./node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.4.2",
    "moment": "^2.24.0",
    "react": "16.8.3",
    "react-native": "0.59.9",
    "react-native-device-info": "^2.1.1",
    "react-native-firebase": "^5.4.3",
    "react-native-voximplant": "^1.7.0",
    "react-native-webview": "^5.12.0",
    "react-navigation": "^2.18.3"
  },
  "devDependencies": {
    "@babel/core": "7.4.5",
    "@babel/runtime": "7.4.5",
    "babel-jest": "24.8.0",
    "jest": "24.8.0",
    "metro-react-native-babel-preset": "0.54.1",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}
Screenshot 2019-06-15 at 2 15 55 PM

Is it mean that i should not "Delete all the library .xcodeproj e.g RNFirebase.xcodeproj?

Screenshot 2019-06-15 at 2 59 19 PM
leon2835 commented 5 years ago

And if i npm install react-native-voximplant@latest --save, without delete all the library, and update podfile with

pod 'react-native-voximplant', path.....' I will get Native modules cannot be null issue.

YuliaGrigorieva commented 5 years ago

Hello @leon2835 ,

Please find my notes below regarding reported issues:

  1. And if i npm install react-native-voximplant@latest --save, without delete all the library, and update podfile with pod 'react-native-voximplant', path.....' I will get Native modules cannot be null issue.

You should remove all libraries from Libraries group as it described in the instructions. We support CocoaPods integration only. Combining different types of integration react native libraries would lead to unexpected behavior and broken application.

  1. Undefined symbol: _OBJCCLASS$_RNFirebaseNotifications - first reported issue.

First of all, this error does not relate to the Voximplant React Native SDK, this is RNFirebase integration issue in your project. Please follow my recommendations:

  1. Remove all xcodeproj files from Libraries group. If you want to use Voximplant React Native SDK in your project you should integrate everything via CocoaPods.
  2. Visit RNFirebase documentation and find the instructions for its integration via Cocoapods: https://rnfirebase.io/docs/v5.x.x/installation/ios#Option-2:-Cocoapods-(Not-Recommended)
  3. Remove use_frameworks! lines from your Podfile
  4. Follow all instructions for Voximplant React Native SDK integration
  5. From /ios directory run pod deintegrate and pod install

Please let me know if you face any issues.

Best regards, Yulia Grigorieva

leon2835 commented 5 years ago

Hi @YuliaGrigorieva , Currently i create a new project, and i npm install react-native-voximplant@latest I deleted all library .xproj file, & successfully build into iphone. But the problem is, if let's say i npm install react-native-gesture-handler & react-native link react-native-gesture-handler & build in IOS. It will should Native module cannot be null. (Perhaps I didnt add xcodeproj file inside library and link in build phases. *How to overcome the issues above? Thank You

leon2835 commented 5 years ago

Issue solved, seems like need rm -rf Pods & pod install again.