Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native module cannot be null. #42

Closed
ricsam opened this issue Jul 14, 2018 · 7 comments
Closed

Native module cannot be null. #42

ricsam opened this issue Jul 14, 2018 · 7 comments

Comments

@ricsam
Copy link

ricsam commented Jul 14, 2018

image

On iOS when running:

import { Voximplant } from 'react-native-voximplant';
const voxClient = Voximplant.getInstance({
  enableVideo: false,
  saveLogsToFile: false,
});

I've followed the steps in README.md

@YuliaGrigorieva
Copy link
Contributor

Hello!

It seems that you have not added react-native-voximplant to your project's Podfile.
Please ensure that:

  1. you have this line in your Podfile:
    https://github.com/voximplant/react-native-demo/blob/568da381ab0725bda7a15f6f57a6ce3bdcc1f118/ios/Podfile#L79
  2. "pod install" command succeeded

Best regards,
Yulia Grigorieva

@ricsam
Copy link
Author

ricsam commented Jul 16, 2018

Hi @YuliaGrigorieva! I have that exact line in my podfile and I can successfully build the project for iOS:

So something else is wrong, do I need to enable something more in xcode? e.g. notifications etc for the SDK to be able to run? I am using React native version 0.56.0.

The SDK works for me on Android.

Thanks!

@YuliaGrigorieva
Copy link
Contributor

Hello!

I was able to reproduce your issue on a project created from scratch with RN 0.56 only if react-native-voximplant is not included to the Podfile.

Generally this error means that native modules of react-native-voximplant are not compiled/linked correctly.

Could you please check that you have build logs for react-native-voximplant framework like this?

image

Do you have a possibility to provide me a sample project on which I could reproduce the issue?

Best regards,
Yulia Grigorieva

@ricsam
Copy link
Author

ricsam commented Jul 16, 2018

@YuliaGrigorieva Thanks for the response! I've created a sample project which gives me the same result: https://github.com/ricsam/testVI
I provided screenshots of my project, build logs and run errors.

Observe that I have not removed anything from the "Libraries" folder in the xcode project. If I remove the *.xcodeproj from "Libraries" the build fails.

@YuliaGrigorieva
Copy link
Contributor

Hello!

It seems to be the root cause of the issue. You should remove all *.xcodeproj from Libraries section because otherwise React is compiled and linked twice (as a framework and as a static library). You can see that RCT classes are located in 2 different locations in your screenshots from the Xcode output.

I have forked your repository and made a commit with the fix. Please take a look: https://github.com/YuliaGrigorieva/testVI

To summarise my changes:

  1. You don't need 'cocoapods-fix-react-native' plugin for RN 0.56. All previous issues in the react-native were fixed. If you take a look at 'cocoapods-fix-react-native' git history, you can see that they have removed all changes for RN 0.56: https://github.com/orta/cocoapods-fix-react-native/commits/master
  2. You may face with 'RCTAnimation/RCTValueAnimatedNode.h' file not found error while building. It can be fixed by adding postintall script in package.json: https://github.com/voximplant/react-native-demo/blob/c6058e6a1635a9123a550ad70bc2e9b32b071a1a/package.json#L7
  3. I have commented out all code in the tests. To resolve compile issues in the tests, it is required to add react dependencies to test target in Podfile.

Please let me know if the issue is resolved on your side.

Best regards,
Yulia Grigorieva

@ricsam
Copy link
Author

ricsam commented Jul 16, 2018

Absolutely amazing, thanks a million! Your forked version worked perfectly! 🎉

@ricsam ricsam closed this as completed Jul 16, 2018
@ozanmanav
Copy link

ozanmanav commented Feb 27, 2019

@YuliaGrigorieva I have a same problem. I tried these things but i'm getting this error.

My Repo : https://github.com/ozanmanav/voxTest2

Is there any idea for this ?

@voximplant voximplant locked and limited conversation to collaborators Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants