'TypeError: dart.global.IrisRtcEngine is not a constructor

The issue arose when porting a folder into my project, even with no references to the other module it ran into a white screen yet when building separately they work perfectly. My pubspec.yaml has been correctly configured, the google-services.json file is present, proguard was also enabled and updated my AndroidManifest.xml appropriately. I have also checked my build.gradle config on both app level and project level. Flutter doctor also ran with no errors.

version: 1.0.0+1

environment: sdk: ">=2.16.0 <3.0.0"

dependencies: flutter: sdk: flutter cloud_firestore: ^3.1.9 firebase_core: ^1.13.1 firebase_auth: ^3.3.9 random_string: ^2.3.1 in_app_purchase: ^3.0.0 flutter_braintree: ^2.3.1 http: ^0.13.4 flutter_webrtc: ^0.8.3 agora_rtc_engine: ^5.0.0 permission_handler: ^9.2.0 auto_size_text: 3.0.0 cached_network_image: 3.1.0+1 font_awesome_flutter: 8.11.0 google_fonts: 2.1.0 intl: 0.17.0 json_path: 0.2.1 page_transition: 2.0.4 shared_preferences: 2.0.11 timeago: 3.1.0 url_launcher: 6.0.15

On my latest build i got these errors, after the voip module was being migrated into my project

Debug service listening on ws://127.0.0.1:56547/U6a7eRxcr7A=/ws

Running with sound null safety Debug service listening on ws://127.0.0.1:56547/U6a7eRxcr7A=/ws TypeError: dart.global.IrisRtcEngine is not a constructor at new agora_rtc_engine_web.AgoraRtcEngineWeb.new (http://localhost:56490/packages/agora_rtc_engine/agora_rtc_engine_web.dart.lib.js:179:26) at Function.registerWith (http://localhost:56490/packages/agora_rtc_engine/agora_rtc_engine_web.dart.lib.js:63:28) at Object.registerPlugins (http://localhost:56490/packages/voip_flutter_v2/generated_plugin_registrant.dart.lib.js:18:44) at main (http://localhost:56490/web_entrypoint.dart.lib.js:32:35) at main.next () at runBody (http://localhost:56490/dart_sdk.js:40590:34) at Object._async [as async] (http://localhost:56490/dart_sdk.js:40621:7) at main$ (http://localhost:56490/web_entrypoint.dart.lib.js:31:18) at http://localhost:56490/main_module.bootstrap.js:19:10 at Array.forEach () at window.$dartRunMain (http://localhost:56490/main_module.bootstrap.js:18:32) at :1:8 at Object.runMain (http://localhost:56490/dwds/src/injected/client.js:8707:21) at http://localhost:56490/dwds/src/injected/client.js:23873:19 at _wrapJsFunctionForAsync_closure.$protected (http://localhost:56490/dwds/src/injected/client.js:3487:15) at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:56490/dwds/src/injected/client.js:11518:12) at Object._asyncStartSync (http://localhost:56490/dwds/src/injected/client.js:3451:20) at main__closure3.$call$body$main__closure (http://localhost:56490/dwds/src/injected/client.js:23885:16) at main__closure3.call$1 (http://localhost:56490/dwds/src/injected/client.js:23812:19) at StaticClosure._rootRunUnary (http://localhost:56490/dwds/src/injected/client.js:3849:18) at _CustomZone.runUnary$2$2 (http://localhost:56490/dwds/src/injected/client.js:12877:39) at _CustomZone.runUnaryGuarded$1$2 (http://localhost:56490/dwds/src/injected/client.js:12813:14) at _ForwardingStreamSubscription._sendData$1 (http://localhost:56490/dwds/src/injected/client.js:12403:19) at _ForwardingStreamSubscription._add$1 (http://localhost:56490/dwds/src/injected/client.js:12349:15) at _ForwardingStreamSubscription._add$1 (http://localhost:56490/dwds/src/injected/client.js:12682:12) at _MapStream._handleData$2 (http://localhost:56490/dwds/src/injected/client.js:12743:12) at _ForwardingStreamSubscription._handleData$1 (http://localhost:56490/dwds/src/injected/client.js:12708:20) at tear_off. (http://localhost:56490/dwds/src/injected/client.js:1392:45) at StaticClosure._rootRunUnary (http://localhost:56490/dwds/src/injected/client.js:3849:18) at _CustomZone.runUnary$2$2 (http://localhost:56490/dwds/src/injected/client.js:12877:39) at _CustomZone.runUnaryGuarded$1$2 (http://localhost:56490/dwds/src/injected/client.js:12813:14) at _ControllerSubscription._sendData$1 (http://localhost:56490/dwds/src/injected/client.js:12403:19) at _ControllerSubscription._add$1 (http://localhost:56490/dwds/src/injected/client.js:12349:15) at _SyncStreamController._sendData$1 (http://localhost:56490/dwds/src/injected/client.js:12197:32) at _SyncStreamController.add$1 (http://localhost:56490/dwds/src/injected/client.js:12078:15) at tear_off. (http://localhost:56490/dwds/src/injected/client.js:1450:48) at StaticClosure._rootRunUnary (http://localhost:56490/dwds/src/injected/client.js:3849:18) at _CustomZone.runUnary$2$2 (http://localhost:56490/dwds/src/injected/client.js:12877:39) at _CustomZone.runUnaryGuarded$1$2 (http://localhost:56490/dwds/src/injected/client.js:12813:14) at _ControllerSubscription._sendData$1 (http://localhost:56490/dwds/src/injected/client.js:12403:19) at _ControllerSubscription._add$1 (http://localhost:56490/dwds/src/injected/client.js:12349:15) at _SyncStreamController._sendData$1 (http://localhost:56490/dwds/src/injected/client.js:12197:32) at _SyncStreamController.add$1 (http://localhost:56490/dwds/src/injected/client.js:12078:15) at _GuaranteeSink.add$1 (http://localhost:56490/dwds/src/injected/client.js:23352:25) at HtmlWebSocketChannel_closure1.call$1 (http://localhost:56490/dwds/src/injected/client.js:23637:149) at _EventStreamSubscription_closure.call$1 (http://localhost:56490/dwds/src/injected/client.js:17865:26) at StaticClosure._rootRunUnary (http://localhost:56490/dwds/src/injected/client.js:3855:16) at _CustomZone.runUnary$2$2 (http://localhost:56490/dwds/src/injected/client.js:12877:39) at _CustomZone.runUnaryGuarded$1$2 (http://localhost:56490/dwds/src/injected/client.js:12813:14) at _CustomZone_bindUnaryCallbackGuarded_closure.call$1 (http://localhost:56490/dwds/src/injected/client.js:13014:25) at invokeClosure (http://localhost:56490/dwds/src/injected/client.js:1281:26) at WebSocket. (http://localhost:56490/dwds/src/injected/client.js:1300:18)

Any suggestions would be much appreciated, i have been researching this issue but to no avail.



Solution 1:[1]

If anyone encounters this error i fixed mine with the pubspec.yaml, i downgraded the permission_handler dependency and it solved my issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 William Selby