react-native-agora: iOS Compile error

Hello, thanks for your great package.

Android works fine for me.

But I experience some issues with ios.

  1. Pod install error When I did pod install it gave me this error. - [!] Pods written in Swift can only be integrated as frameworks; add use_frameworks! to your Podfile or target to opt into using it. The Swift Pod being used is: react-native-agora So I added use_frameworks! to Podfile and it resolved pod install error.

  2. Compile error After pod install was successful I tried to build it and it gave me following errors. Swift Compiler Error /myproject/node_modules/react-native-agora/ios/RCTAgora/React/PromiseCallback.swift:14:26: Use of undeclared type 'RCTPromiseResolveBlock' /myproject/node_modules/react-native-agora/ios/RCTAgora/React/PromiseCallback.swift:15:25: Use of undeclared type 'RCTPromiseRejectBlock' ... ... /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcChannelModule.swift:25:25: Method does not override any method from its superclass ... ... /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcChannelModule.swift:13:33: Use of undeclared type 'RCTEventEmitter' ... ... /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcChannelModule.swift:12:2: Only classes that inherit from NSObject can be declared @objc ... ... /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcSurfaceViewManager.swift:14:19: Method does not override any method from its superclass ... ... /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcSurfaceViewManager.swift:13:38: Use of undeclared type 'RCTViewManager' /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcSurfaceViewManager.swift:30:17: Use of unresolved identifier 'bridge' /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcSurfaceViewManager.swift:34:17: Use of unresolved identifier 'bridge' /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcEngineModule.swift:63:13: Use of unresolved identifier 'sendEvent' /myproject/node_modules/react-native-agora/ios/RCTAgora/React/RCTAgoraRtcEngineModule.swift:12:2: Only classes that inherit from NSObject can be declared @objc Screenshot_162

Any solution for this swift compiler error?

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18

Most upvoted comments

@LichKing-2234 Yes, upgrading cocoapods version worked for me. Thank you!