wangzhi17 / react-native-ezviz-player

React Native 新架构集成萤石云SDK,实现预览和对讲功能,新架构在iOS和android端都已经实现。暂未兼容React Native旧架构。支持reactnative 0.73和react native 0.74.3以上。
MIT License
0 stars 1 forks source link

我运行安卓的是报错,可以帮我看看吗,谢了 #1

Closed yuanqing-fu closed 1 month ago

yuanqing-fu commented 1 month ago

我的React Native版本是0.73.8已经开启了新架构 react-native-ezviz-player的版本是1.1.6

Task :react-native-ezviz-player:compileDebugJavaWithJavac FAILED 109 actionable tasks: 7 executed, 102 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

/Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:20: 错误: RCTEzvizPlayerModule不是抽象的, 并且未覆盖NativeEzvizVoiceTalkSpec中的抽象方法removeListeners(double) public class RCTEzvizPlayerModule extends NativeEzvizVoiceTalkSpec implements Handler.Callback { ^ /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:53: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:99: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 3 个错误

FAILURE: Build failed with an exception.

BUILD FAILED in 8s error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:20: 错误: RCTEzvizPlayerModule不是抽象的, 并且未覆盖NativeEzvizVoiceTalkSpec中的抽象方法removeListeners(double) public class RCTEzvizPlayerModule extends NativeEzvizVoiceTalkSpec implements Handler.Callback { ^ /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:53: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:99: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 3 个错误 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-ezviz-player:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details. Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org BUILD FAILED in 8s. info Run CLI with --verbose flag for more details. error Command failed with exit code 1.

wangzhi17 commented 1 month ago

android部分需要执行cd android && ./gradlew generateCodegenArtifactsFromSchema

yuanqing-fu commented 1 month ago

好的,我试试,谢了

橡果 @.***

原始邮件

发件人:"汪志"< @.*** >;

发件时间:2024/7/9 17:26

收件人:"wangzhi17/react-native-ezviz-player"< @.*** >;

抄送人:"James Fu"< @. >;"Author"< @. >;

主题:Re: [wangzhi17/react-native-ezviz-player] 我运行安卓的是报错,可以帮我看看吗,谢了 (Issue #1)

android部分需要执行cd android && ./gradlew generateCodegenArtifactsFromSchema

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

yuanqing-fu commented 1 month ago

android部分需要执行cd android && ./gradlew generateCodegenArtifactsFromSchema

app/build/generated/source/codegen下面也是生成了代码的,但是运行后还是报如下错误,: /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:20: 错误: RCTEzvizPlayerModule不是抽象的, 并且未覆盖NativeEzvizVoiceTalkSpec中的抽象方法removeListeners(double) public class RCTEzvizPlayerModule extends NativeEzvizVoiceTalkSpec implements Handler.Callback { ^ /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:53: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ /Users/apple/Desktop/workspace/concrete-sense-app-monitor/node_modules/react-native-ezviz-player/android/src/main/java/cn/wangzhi17/ezviz/player/RCTEzvizPlayerModule.java:99: 错误: 方法不会覆盖或实现超类型的方法 @Override

pmorandi23 commented 1 month ago

Hello @wangzhi17, how are you?

Iam trying to use your npm package in my Expo React Native app. When i generate a development build with npm run android i am havin the following errors:

Task :react-native-ezviz-player:compileDebugJavaWithJavac FAILED

...node_modules\react-native-ezviz-player\android\src\main\java\cn\wangzhi17\ezviz\player\RCTEzvizPlayerModule.java:20: error: RCTEzvizPlayerModule is not abstract and does not override abstract method removeListeners(double) in NativeEzvizVoiceTalkSpec public class RCTEzvizPlayerModule extends NativeEzvizVoiceTalkSpec implements Handler.Callback { ^ ...node_modules\react-native-ezviz-player\android\src\main\java\cn\wangzhi17\ezviz\player\RCTEzvizPlayerModule.java:53: error: method does not override or implement a method from a supertype @Override ^ ...node_modules\react-native-ezviz-player\android\src\main\java\cn\wangzhi17\ezviz\player\RCTEzvizPlayerModule.java:99: error: method does not override or implement a method from a supertype @Override ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 errors

I hope you can help me with this issue

many thanks!!

wangzhi17 commented 1 month ago

Hello, I think the error message should be that the version of React Native does not correspond. You need to use react naitve 0.74 and above.

pmorandi23 commented 1 month ago

Hello. I still having same issue

My project package.json settings are:

  "name": "EzvizIntegrationTest",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "react": "18.2.0",
    "react-native": "0.74.3",
    "react-native-ezviz-player": "^1.1.9"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.74.85",
    "@react-native/eslint-config": "0.74.85",
    "@react-native/metro-config": "0.74.85",
    "@react-native/typescript-config": "0.74.85",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

I am now trying in a bare React Native project (without Expo) and having same error when compiling

The steps I am following:

  1. install the package via npm with npm i react-native-ezviz-player
  2. cd android & ./gradlew generateCodegenArtifactsFromSchema
  3. npm run android ---> compile with thhe following errors

Reading the error:

  1. C:\pruebas-projects\EzvizIntegrationTest\node_modules\react-native-ezviz-player\android\src\main\java\cn\wangzhi17\ezviz\player\RCTEzvizPlayerModule.java:20: error: RCTEzvizPlayerModule is not abstract and does not override abstract method removeListeners(double) in NativeEzvizVoiceTalkSpec public class RCTEzvizPlayerModule extends NativeEzvizVoiceTalkSpec implements Handler.Callback {

Here the method receive an int:

image

And at NativeEzvizVoiceTalkSpec is declarated with a double:

image

  1. C:\pruebas-projects\EzvizIntegrationTest\node_modules\react-native-ezviz-player\android\src\main\java\cn\wangzhi17\ezviz\player\RCTEzvizPlayerModule.java:53: error: method does not override or implement a method from a supertype @Override

Here method receives an int cameraNo

image

And its declarated with a double:

image

  1. C:\pruebas-projects\EzvizIntegrationTest\node_modules\react-native-ezviz-player\android\src\main\java\cn\wangzhi17\ezviz\player\RCTEzvizPlayerModule.java:99: error: method does not override or implement a method from a supertype @Override ^ Note: Some input files use or override a deprecated API.

And this is related to error 1

Please, can you tell me if this are need to be fixed to make this library work?

Many Thanks

wangzhi17 commented 1 month ago

It seems that the type of the automatically generated parent class is wrong. You are right, public abstract void removeListeners(int count), the method parameter of removeListeners should be of int type. Can you provide me with a demo? I have modified the submission for you. For a moment, because I have no problem here.

wangzhi17 commented 1 month ago

@pmorandi23

wangzhi17 commented 1 month ago
image
pmorandi23 commented 1 month ago

Hello @wangzhi17 , thanks for your reply

I have downgrade react-native version to 0.74.2 and it compile without errors. This will be working at above react native versions?

Now, when i try to connect to my camera, i always having "play failed" error

This is my impementation:

  <EzvizPlayerView
    style={{backgroundColor: 'red', width: '100%', height: 200}}
    accessToken="xxxxx"  // my accessToken
    deviceSerial="xxxxx"   // my deviceSerial
    cameraNo={1}
    verifyCode="xxxxx" // my verifyCode
    onPlayFailed={() => console.log('play failed')}
    onLoad={() => {
      console.log('onLoad');
    }}
  />

Now I think, isnt missing the AppKey to get the URL to preview the monitoring?

Is there something I mising?

Many thanks

wangzhi17 commented 1 month ago

Yes, you need to call EzvizPlayerVoiceTalk.initSDK to initialize the SDK. I will give you a reference code. @pmorandi23

wangzhi17 commented 1 month ago
image
wangzhi17 commented 1 month ago
image
pmorandi23 commented 1 month ago

Thanks for the example code. @wangzhi17

Still having "play failed", but the initSDK functions returns true

The ref at EzvizPlayerView where did you declare it?

This is my code:

function App(): React.JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  const ezvizPlayerRef = useRef();

  useEffect(() => {
    const initEzviCameraSDK = async () => {
      const player = await EzvizPlayerVoiceTalk.initSDK(
        'xxxxxx', //my appKey
      );
      console.log('player: ', player); // this is true
    };

    const destroyEzviCameraSDK = async () => {
      await EzvizPlayerVoiceTalk.destroySDK();
    };

    initEzviCameraSDK();

    return () => {
      destroyEzviCameraSDK();
    };
  }, []);

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <EzvizPlayerView
        ref={ezvizPlayerRef}
        style={{backgroundColor: 'red', width: '100%', height: 200}}
        accessToken="xxxxxx"
        deviceSerial="xxxxx"
        cameraNo={1}
        verifyCode="xxxxx"
        onPlayFailed={e => console.log('play failed')}
        onLoad={() => {
          console.log('onLoad');
          ezvizPlayerRef.current.createPlayer();
        }}
      />
    </SafeAreaView>
  );
}

export default App;
wangzhi17 commented 1 month ago

EzvizPlayerVoiceTalk.initSDK needs to be executed before ezvizPlayerRef.current.createPlayer(), and initSDK will take some time. In the example you provided, createPlayer is executed before initSDK.

pmorandi23 commented 1 month ago

Ok. So I put a button to test what yo say @wangzhi17

But I still dont undestand where does "ref" has to be declared. Can you tell me that ? I think with that ref I can createPlayer and destroyPlayer....

This is my code now, and still having "play failed" after pressing "Init camera" Button

function App(): React.JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
    flex: 1,
    justifyContent: 'center',
  };

  const ezvizPlayerRef = useRef();
  const [isEzvizSDKInitialized, setIsEzvizSDKInitialized] =
    useState<boolean>(false);

  const initEzviCameraSDK = async () => {
    const _isEzvizSDKInitialized = await EzvizPlayerVoiceTalk.initSDK(
      'xxxxxxx',
    );
    setIsEzvizSDKInitialized(_isEzvizSDKInitialized);
    console.log('_isEzvizSDKInitialized: ', _isEzvizSDKInitialized);
  };

  const destroyEzviCameraSDK = async () => {
    await EzvizPlayerVoiceTalk.destroySDK();
  };

  const initEzvizSDK = () => {
    initEzviCameraSDK();
  };

  return (
    <SafeAreaView
      style={{
        backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
        flex: 1,
        justifyContent: 'center',
      }}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      {isEzvizSDKInitialized ? (
        <EzvizPlayerView
          ref={ezvizPlayerRef}
          style={{backgroundColor: 'red', width: '100%', height: 200}}
          accessToken="xxxxxxl"
          deviceSerial="xxxxx"
          cameraNo={1}
          verifyCode="xxxxx"
          onPlayFailed={event => console.log('play failed: ', event)}
          onLoad={() => {
            console.log('onLoad');
            ezvizPlayerRef.current.createPlayer();
          }}
        />
      ) : (
        <Text style={{textAlign: 'center'}}>Waiting for init SDK...</Text>
      )}
      <View>
        <Button title="Init camera" onPress={initEzvizSDK} />
      </View>
      <View>
        <Button title="Destroy camera" onPress={destroyEzviCameraSDK} />
      </View>
    </SafeAreaView>
  );
}

export default App;

And this is what "event" has when fails at onPlayFailed:

play failed:  {"_dispatchInstances": {"_debugHookTypes": null, "_debugNeedsRemount": false, "_debugOwner": {"_debugHookTypes": [Array], "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "actualDuration": 5.804427921772003, "actualStartTime": 295262827.306983, "alternate": null, "child": [Circular], "childLanes": 0, "deletions": null, "dependencies": null, "elementType": [Object], "flags": 37748741, "index": 1, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": [Object], "mode": 2, "pendingProps": [Object], "ref": [Object], "refCleanup": null, "return": [FiberNode], "selfBaseDuration": 0.5843749642372131, "sibling": [FiberNode], "stateNode": null, "subtreeFlags": 2097664, "tag": 11, "treeBaseDuration": 0.609062910079956, "type": [Object], "updateQueue": [Object]}, "actualDuration": 5.214584946632385, "actualStartTime": 295262827.898545, "alternate": null, "child": null, "childLanes": 0, "deletions": null, "dependencies": null, "elementType": "EzvizPlayer", "flags": 2097664, "index": 0, "key": null, "lanes": 0, "memoizedProps": {"accessToken": "at.bkcoa0uz3d1aum7oc9eh4ouadpp88ygr-8z6f84fy0j-0dqxbni-fgslcvcyl", "cameraNo": 1, "deviceSerial": "BB3611446", "onPlayFailed": [Function onPlayFailed], "style": [Object], "verifyCode": "pabloCam"}, "memoizedState": null, "mode": 2, "pendingProps": {"accessToken": "at.bkcoa0uz3d1aum7oc9eh4ouadpp88ygr-8z6f84fy0j-0dqxbni-fgslcvcyl", "cameraNo": 1, "deviceSerial": "BB3611446", "onPlayFailed": [Function onPlayFailed], "style": [Object], "verifyCode": "pabloCam"}, "ref": {"current": [ReactNativeFiberHostComponent]}, "refCleanup": null, "return": {"_debugHookTypes": [Array], "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "actualDuration": 5.804427921772003, "actualStartTime": 295262827.306983, "alternate": null, "child": [Circular], "childLanes": 0, "deletions": null, "dependencies": null, "elementType": [Object], "flags": 37748741, "index": 1, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": [Object], "mode": 2, "pendingProps": [Object], "ref": [Object], "refCleanup": null, "return": [FiberNode], "selfBaseDuration": 0.5843749642372131, "sibling": [FiberNode], "stateNode": null, "subtreeFlags": 2097664, "tag": 11, "treeBaseDuration": 0.609062910079956, "type": [Object], "updateQueue": [Object]}, "selfBaseDuration": 0.02468794584274292, "sibling": null, "stateNode": {"_children": [Array], "_internalFiberInstanceHandleDEV": [Circular], "_nativeTag": 39, "viewConfig": [Object]}, "subtreeFlags": 0, "tag": 5, "treeBaseDuration": 0.02468794584274292, "type": "EzvizPlayer", "updateQueue": null}, "_dispatchListeners": [Function onPlayFailed], "_targetInst": {"_debugHookTypes": null, "_debugNeedsRemount": false, "_debugOwner": {"_debugHookTypes": [Array], "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "actualDuration": 5.804427921772003, "actualStartTime": 295262827.306983, "alternate": null, "child": [Circular], "childLanes": 0, "deletions": null, "dependencies": null, "elementType": [Object], "flags": 37748741, "index": 1, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": [Object], "mode": 2, "pendingProps": [Object], "ref": [Object], "refCleanup": null, "return": [FiberNode], "selfBaseDuration": 0.5843749642372131, "sibling": [FiberNode], "stateNode": null, "subtreeFlags": 2097664, "tag": 11, "treeBaseDuration": 0.609062910079956, "type": [Object], "updateQueue": [Object]}, "actualDuration": 5.214584946632385, "actualStartTime": 295262827.898545, "alternate": null, "child": null, "childLanes": 0, "deletions": null, "dependencies": null, "elementType": "EzvizPlayer", "flags": 2097664, "index": 0, "key": null, "lanes": 0, "memoizedProps": {"accessToken": "at.bkcoa0uz3d1aum7oc9eh4ouadpp88ygr-8z6f84fy0j-0dqxbni-fgslcvcyl", "cameraNo": 1, "deviceSerial": "BB3611446", "onPlayFailed": [Function onPlayFailed], "style": [Object], "verifyCode": "pabloCam"}, "memoizedState": null, "mode": 2, "pendingProps": {"accessToken": "at.bkcoa0uz3d1aum7oc9eh4ouadpp88ygr-8z6f84fy0j-0dqxbni-fgslcvcyl", "cameraNo": 1, "deviceSerial": "BB3611446", "onPlayFailed": [Function onPlayFailed], "style": [Object], "verifyCode": "pabloCam"}, "ref": {"current": [ReactNativeFiberHostComponent]}, "refCleanup": null, "return": {"_debugHookTypes": [Array], "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "actualDuration": 5.804427921772003, "actualStartTime": 295262827.306983, "alternate": null, "child": [Circular], "childLanes": 0, "deletions": null, "dependencies": null, "elementType": [Object], "flags": 37748741, "index": 1, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": [Object], "mode": 2, "pendingProps": [Object], "ref": [Object], "refCleanup": null, "return": [FiberNode], "selfBaseDuration": 0.5843749642372131, "sibling": [FiberNode], "stateNode": null, "subtreeFlags": 2097664, "tag": 11, "treeBaseDuration": 0.609062910079956, "type": [Object], "updateQueue": [Object]}, "selfBaseDuration": 0.02468794584274292, "sibling": null, "stateNode": {"_children": [Array], "_internalFiberInstanceHandleDEV": [Circular], "_nativeTag": 39, "viewConfig": [Object]}, "subtreeFlags": 0, "tag": 5, "treeBaseDuration": 0.02468794584274292, "type": "EzvizPlayer", "updateQueue": null}, "bubbles": undefined, "cancelable": undefined, "currentTarget": {"_children": [], "_internalFiberInstanceHandleDEV": {"_debugHookTypes": null, "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "actualDuration": 5.214584946632385, "actualStartTime": 295262827.898545, "alternate": null, "child": null, "childLanes": 0, "deletions": null, "dependencies": null, "elementType": "EzvizPlayer", "flags": 2097664, "index": 0, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": null, "mode": 2, "pendingProps": [Object], "ref": [Object], "refCleanup": null, "return": [FiberNode], "selfBaseDuration": 0.02468794584274292, "sibling": null, "stateNode": [Circular], "subtreeFlags": 0, "tag": 5, "treeBaseDuration": 0.02468794584274292, "type": "EzvizPlayer", "updateQueue": null}, "_nativeTag": 39, "viewConfig": {"NativeProps": [Object], "bubblingEventTypes": [Object], "directEventTypes": [Object], "uiViewClassName": "EzvizPlayer", "validAttributes": [Object]}}, "defaultPrevented": undefined, "dispatchConfig": {"registrationName": "onPlayFailed"}, "eventPhase": undefined, "isDefaultPrevented": [Function functionThatReturnsFalse], "isPropagationStopped": [Function functionThatReturnsFalse], "isTrusted": undefined, "nativeEvent": {}, "target": {"_children": [], "_internalFiberInstanceHandleDEV": {"_debugHookTypes": null, "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "actualDuration": 5.214584946632385, "actualStartTime": 295262827.898545, "alternate": null, "child": null, "childLanes": 0, "deletions": null, "dependencies": null, "elementType": "EzvizPlayer", "flags": 2097664, "index": 0, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": null, "mode": 2, "pendingProps": [Object], "ref": [Object], "refCleanup": null, "return": [FiberNode], "selfBaseDuration": 0.02468794584274292, "sibling": null, "stateNode": [Circular], "subtreeFlags": 0, "tag": 5, "treeBaseDuration": 0.02468794584274292, "type": "EzvizPlayer", "updateQueue": null}, "_nativeTag": 39, "viewConfig": {"NativeProps": [Object], "bubblingEventTypes": [Object], "directEventTypes": [Object], "uiViewClassName": "EzvizPlayer", "validAttributes": [Object]}}, "timeStamp": 1721229291722, "type": undefined}
pmorandi23 commented 1 month ago

@wangzhi17 , Another bug I having is with Android Emulador (not with physical device) when I try to run EzvizPlayerVoiceTalk.initSDK

image

wangzhi17 commented 1 month ago
image

Console.log(event.nativeEvent) obtains the reason for playback failure

wangzhi17 commented 1 month ago

This SDK does not support simulators. You need to use a real machine or use m1 Mac to debug.

pmorandi23 commented 1 month ago

image Console.log(event.nativeEvent) obtains the reason for playback failure

I having an empty object in response

{}

wangzhi17 commented 1 month ago

You may need to open android studio to view logcat, because I have never encountered an error message returned as {}. Use EZOpenSDK.showSDKLog(true) to open specific information. Can you read Chinese? @pmorandi23

pmorandi23 commented 1 month ago

I cant read Chinese, I do what I can jajaja

I am on Windows 11 with VSCode running the React Native dev server

Would you please provide me a complete example code for testing this? Many thanks in advance

Now I will try on Mac....

wangzhi17 commented 1 month ago

https://github.com/wangzhi17/AwesomeProjectLast @pmorandi23

pmorandi23 commented 1 month ago

Thanks @wangzhi17 !! I willl try it and comment you

pmorandi23 commented 1 month ago

Trying your code, i have this event.nativeEvent at onPlayFailed:

(NOBRIDGE) LOG {"description": "AccessToken异常,可能是过期或者校验失败,重新获取accessToken后可重试(转义前错误码110002)", "errorCode": 400902, "sulution": null, "target": 2}

The accessToken and the appKey I am getting are correct ! I am taking from here:

image

Where should I check ?

Thanks @wangzhi17

wangzhi17 commented 1 month ago

I think you need to upgrade the version to 1.1.11, then re-obtain the accessToken and update AwesomeProjectLast. @pmorandi23

pmorandi23 commented 1 month ago

Hello @wangzhi17 ! I upgraded to version 1.1.11 with the example AwesomeProjectLast , set the appKey and the accessToken and I have this error in event.nativeEvevent at onPlayFailed:

(NOBRIDGE) LOG {"description": "unknow error.", "errorCode": 250000, "sulution": null, "target": 56}

I see you added thhe url to the init SDK. That URL is fixed?

Thanks!!

pmorandi23 commented 1 month ago

@wangzhi17 now it's working!! For Android device at least, now I will try on iOS device

You need to fix the URL!!

it's: "https://isaopen.ezvizlife.com". Was missing the "life" word

wangzhi17 commented 1 month ago

image yes,you are right

wangzhi17 commented 1 month ago

The default server of the SDK is mainland China. Other countries need to set this service address to work.