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

Render Error : null is not an object (evaluating 'ClientModule.init') #165

Open
Yashg2001 opened this issue Jul 10, 2022 · 5 comments
Open

Comments

@Yashg2001
Copy link

So, I was trying to get instance from voximplant and I encountered this problem. Any solution to this problem?

This is my code:
import {Voximplant} from 'react-native-voximplant';
import {useNavigation} from '@react-navigation/core';
import React, {useState, useEffect} from 'react';
import {
View,
TextInput,
StyleSheet,
Pressable,
Text,
Alert,
} from 'react-native';

import {APP_NAME, ACC_NAME} from '../../Constants';

const LoginScreen = () => {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const voximplant = Voximplant.getInstance();
const navigation = useNavigation();

useEffect(() => {
const connect = async () => {
const status = await voximplant.getClientState();
if (status === Voximplant.ClientState.DISCONNECTED) {
await voximplant.connect();
} else if (status === Voximplant.ClientState.LOGGED_IN) {
redirectHome();
}
};

connect();

}, []);

const signIn = async () => {
try {
const fqUsername = ${username}@${APP_NAME}.${ACC_NAME}.voximplant.com;
await voximplant.login(fqUsername, password);

  redirectHome();
}

image

@pe1ros
Copy link
Contributor

pe1ros commented Jul 12, 2022

Hello @Yashg2001

Do you use Expo or pure react-native flow?

@Yashg2001
Copy link
Author

Hello @Yashg2001

Do you use Expo or pure react-native flow?

Pure react-native

@pe1ros
Copy link
Contributor

pe1ros commented Jul 14, 2022

Hello @Yashg2001

Please try to do these steps:

  1. In YouRNProject/android directory run command ./gradlew clean
  2. In YouRNProject directory run command rm -rf node_modules
  3. Check that you have last version react-native-voximplant
  4. Install again node_modules (yarn install or npm install)
  5. Run your project again

@badal-ag
Copy link

Hello @Yashg2001

Do you use Expo or pure react-native flow?

Hey, I am using expo but facing the same issue. Installed the node modules again too. But, the error still persists.

@pe1ros
Copy link
Contributor

pe1ros commented Aug 1, 2022

Hello @badal-ag

Expo provides two workflows (Managed and Bare)
Voximplant React Native SDK uses native modules, that's why React Native application (based on Expo) should use only Bare workflow. It means you need to "eject".
If you are using Expo SDK 40 or below, please follow the instruction on this page
For Expo SDK 41, please follow the instruction on this page

Please consider that moving to the bare workflow may cause the issues such as:

  •   You need Xcode and Android Studio to develop or build the native code.
    
  •   React native version should be upgraded manually.
    
  •   and others described here => https://docs.expo.dev/expokit/eject/#should-i-eject-to-expokit
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants