Problem
Get error
"Module 'nativescript-webrtc-plugin' not found for element 'nativescript-webrtc-plugin:WebRTCView"
"Class constructor View cannot be invoked without 'new'"
when trying to use WebRTCView in my xml file.
Which platform(s) does your issue occur on?
- Android emulator: target = Android 11.0 (Google APIS)
Please, provide the following version numbers that your issue occurs with:
- CLI: 7.0.11
- Cross-platform modules: dont have tns core modules, have is-core-module 2.0.0
- Runtime(s): dont see ios or android properties in my package.json
- Plugin(s): Version Number: 7.0.2
"dependencies": {
"@nativescript/core": "~7.0.0",
"@nativescript/theme": "~2.3.0",
"nativescript-imagepicker": "^7.1.0",
"nativescript-modal-datetimepicker": "^1.2.3",
"nativescript-permissions": "^1.3.11",
"nativescript-ui-sidedrawer": "~9.0.0",
"nativescript-webrtc-plugin": "^2.0.0-alpha.22",
"nativescript-websockets": "^1.5.5",
"rxjs": "^6.6.0"
},
"devDependencies": {
"@nativescript/android": "7.0.1",
"@nativescript/webpack": "~3.0.0",
"eslint": "~7.7.0",
"node-sass": "^4.14.1"
},
Please, tell us how to recreate the issue in as much detail as possible.
- Install plugin with "ns plugin add nativescript-webrtc-plugin"
- Init plugin in app.js
- Navigate to page with WebRTCView
Is there any code involved?
app.js
(had issues with this initially and found someone saying you needed to switch build gradle to 3.4.2 so I did)
const WebRTC = require("nativescript-webrtc-plugin").WebRTC;
//requires android build.gradle to be version 3.4.2
WebRTC.init();
xml page
<Page
navigatingTo="onNavigatingTo"
navigatedTo="onNavigatedTo"
xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:ui="nativescript-webrtc-plugin">
<GridLayout class="page__content">
<ScrollView>
<StackLayout orientation="vertical" id="main_stack" class="nt-form">
<ui:WebRTCView id="remoteVideoView" />
</StackLayout>
</ScrollView>
</GridLayout>
</Page>
Problem
Get error
"Module 'nativescript-webrtc-plugin' not found for element 'nativescript-webrtc-plugin:WebRTCView"
"Class constructor View cannot be invoked without 'new'"
when trying to use WebRTCView in my xml file.
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
"dependencies": {
"@nativescript/core": "~7.0.0",
"@nativescript/theme": "~2.3.0",
"nativescript-imagepicker": "^7.1.0",
"nativescript-modal-datetimepicker": "^1.2.3",
"nativescript-permissions": "^1.3.11",
"nativescript-ui-sidedrawer": "~9.0.0",
"nativescript-webrtc-plugin": "^2.0.0-alpha.22",
"nativescript-websockets": "^1.5.5",
"rxjs": "^6.6.0"
},
"devDependencies": {
"@nativescript/android": "7.0.1",
"@nativescript/webpack": "~3.0.0",
"eslint": "~7.7.0",
"node-sass": "^4.14.1"
},
Please, tell us how to recreate the issue in as much detail as possible.
Is there any code involved?
app.js
(had issues with this initially and found someone saying you needed to switch build gradle to 3.4.2 so I did)
xml page