opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
212 stars 156 forks source link

[Android] Native Module doesn't link properly when using with react-native-navigation #205

Closed codvlpr closed 2 years ago

codvlpr commented 5 years ago

I'm trying to integrate opentok react native library in my react native app. I've started the app with react-native init and followed the installation process as per the README of this repo but still getting this error. I've tried to run my project on simulator and on a real device too but no luck. whatsapp image 2018-12-11 at 23 21 11

msach22 commented 5 years ago

@codvlpr Thanks for filing the issue. Is this happening for iOS or Android?

codvlpr commented 5 years ago

Android as of now. Not tested on iOS.

msach22 commented 5 years ago

@codvlpr Thanks for sharing. I'm unable to reproduce this issue: I created a fresh new project using (react-native init) and linked the library (react-native link opentok-react-native).

Are you seeing this on a specific device or is there any other information that you can provide that will help me reproduce the issue?

codvlpr commented 5 years ago

I'm using react-native-navigation and react-native-vector-icons in my project as external libraries. Kindly review the sdk versions and all. If there's anything I'm missing here please let me know. buildToolsVersion = "27.0.3" minSdkVersion = 19 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1"

codvlpr commented 5 years ago

Oh and I'm using ReactNative 0.57.7 Does react native version have anything to do with this library?

msach22 commented 5 years ago

@codvlpr Thanks for sharing. I created another fresh project using React Native 0.57.7 and added the latest version of this library and I'm unable to reproduce the issue.

msach22 commented 5 years ago

Can you check and see if you're compiling the opentok-react-native android bindings with your Android project?

codvlpr commented 5 years ago

Okay. I've identified the issue, If the react native app is using react-native-navigation package then the code structure for MainApplication.java will be changed so the react-native link opentok-react-native will import the OTPackage but will fail to actually include in the getPackages list. I had to manually add the package and everything was good to go. I know the issue but I don't how to fix and commit :|

msach22 commented 5 years ago

@codvlpr Thanks for updating me. I'm happy to hear that you were able to get it working, but I'm not sure why this is happening because this is automatically handled via react-native link (formerly known as rnpm link). This could be a bug with react-native link or the way we're defining OTPackage. I will investigate further and update you.