nagarro-dv / react-native-zoom-us-bridge

React Native bridge for Zoom SDK for iOS + Android
MIT License
45 stars 23 forks source link

TypeError: Cannot read property 'initialize' of undefined #7

Closed gabrielbabierra closed 4 years ago

gabrielbabierra commented 4 years ago

I inserted this inside my javascript code

import RNZoomUsBridge from '@mokriya/react-native-zoom-us-bridge';

RNZoomUsBridge.initialize( ZOOM_APP_KEY, ZOOM_APP_SECRET, );

As instructed from your documentations. Then i got an error in android saying 'TypeError: Cannot read property 'initialize' of undefined'. Followed the procedures accordingly based from the documentations. My react native version is 61.2.

It seems that i need to manually install it and add lines on my android codes. Here are the steps i did to bypass this issue:

Inserted in android/settings.gradle include ':@mokriya_react-native-zoom' project(':@mokriya_react-native-zoom').projectDir = new File(rootProject.projectDir, '../node_modules/@mokriya/react-native-zoom-us-bridge/android')

android/app/build.gradle implementation project(':@mokriya_react-native-zoom')

android/app/src/main/java/com/bridged/MainApplication.java On top of the imports import com.mokriya.zoomus.RNZoomUsBridgePackage; then at the getPackages new RNZoomUsBridgePackage()

Then the issue solved.

Thanks

jimji1005 commented 4 years ago

@gabrielbabierra I took a quick look at the issue.

I started with a new project with 61.2, auto link was able to link the library.

I also tested react-native link and it added the proper lines to settings.gradle

project(':@mokriya_react-native-zoom-us-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/@mokriya/react-native-zoom-us-bridge/android')

Are you using manual linking?