Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant find custom WebRTCView #54

Open
rgill02 opened this issue Nov 1, 2020 · 3 comments
Open

Cant find custom WebRTCView #54

rgill02 opened this issue Nov 1, 2020 · 3 comments

Comments

@rgill02
Copy link

rgill02 commented Nov 1, 2020

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>
@naveedpash
Copy link

I'm having the same problem, please help

@rgill02
Copy link
Author

rgill02 commented Nov 27, 2020

Had to downgrade from nativescript 7.0.11 to 6.8.0 to get this to work.

@triniwiz
Copy link
Owner

triniwiz commented Nov 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants