Home > Software design >  ERROR TypeError: Cannot read property 'SurfaceView' of undefined from Agora VideoUIKit
ERROR TypeError: Cannot read property 'SurfaceView' of undefined from Agora VideoUIKit

Time:11-09

i use VideoUIKit-ReactNative Agora and my code is :

import React, {useState} from 'react';
import AgoraUIKit from 'agora-rn-uikit';

const App = () => {
  const [videoCall, setVideoCall] = useState(true);
  const connectionData = {
    appId: '<Agora App ID>',
    channel: 'test',
  };
  const rtcCallbacks = {
    EndCall: () => setVideoCall(false),
  };
  return videoCall ? (
    <AgoraUIKit connectionData={connectionData} rtcCallbacks={rtcCallbacks} />
  ) : (
    <Text onPress={()=>setVideoCall(true)}>Start Call</Text>
  );
};

export default App;

but when i build android on my device ,i get error:

**TypeError: Cannot read property 'SurfaceView' of undefined, js engine: hermes **

what do i do ??

i want solve my issue

CodePudding user response:

I had a similar issue. As mentioned here downgrading Agora SDK to v3.7.x resolved the issue for me. It seems agora-rn-uikit does not support latest sdk version yet.

  • Related