Skip to content

Cant find custom WebRTCView #54

Description

@rgill02

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.

  1. Install plugin with "ns plugin add nativescript-webrtc-plugin"
  2. Init plugin in app.js
  3. 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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions