'Native script angular android app error with nativescript-webrtc
Getting error like :
Error executing Static Binding Generator: File already exists. This may lead to undesired behavior. Please change the name of one of the extended classes. File:D:\BeHappy\Android App\BeHappy\platforms\android\app\src\main\java\com\tns\FragmentClass.java Class: com.tns.FragmentClass Detailed log here: D:\BeHappy\Android App\BeHappy\platforms\android\build-tools\runSbg.log
Command gradlew.bat failed with exit code 1
Package.json: { "name": "BeHappy", "main": "src/main.ts", "version": "1.0.0", "private": true, "dependencies": { "@angular/animations": "~13.1.1", "@angular/common": "~13.1.1", "@angular/compiler": "~13.1.1", "@angular/core": "~13.1.1", "@angular/forms": "~13.1.1", "@angular/platform-browser": "~13.1.1", "@angular/platform-browser-dynamic": "~13.1.1", "@angular/router": "~13.1.1", "@nativescript/angular": "^13.0.0", "@nativescript/core": "~8.1.1", "@nativescript/theme": "~3.0.1", "nativescript-ui-sidedrawer": "~10.0.1", "nativescript-webrtc-plugin": "^2.0.0-alpha.22", "rxjs": "~7.4.0", "tns-core-modules": "^6.5.27", "zone.js": "~0.11.4" }, "devDependencies": { "@angular-devkit/build-angular": "~13.1.1", "@angular/compiler-cli": "~13.1.1", "@nativescript/android": "8.1.1", "@nativescript/types": "~8.1.1", "@nativescript/webpack": "~5.0.0", "@ngtools/webpack": "~13.1.1", "typescript": "~4.4.4" } }
Other versions I am using as: TNS : 8.1 gradle : 6.4 jdk - 1.8
Solution 1:[1]
Unfortunately, the nativescript-webrtc plugin is not update. There are some banking change in NativeScript 7 and the Author of plugin has to update it and the last update from nativescript-webrtc was for 3 years ago.
Somebody has already updated to ns7/8, but the author didn't merge it with master branch. (https://github.com/triniwiz/nativescript-webrtc/pull/61)
To fix that, you can do the following steps:
- Clone the
nativescript-webrtcrepository - Merge the PR with master branch in your local system (see this link to how you can do that: GitHub clone from pull request?)
- Run
npm run buildin clone repository - Run
tns plugin remove nativescript-webrtc-pluginin your NativeScript project - Run
tns cleanin your NativeScript project - Remove
node_modulefolder from your NativeScript project - Run
npm iin your NativeScript project - Run
tns plugin add [RELATIVE PATH TO CLONE REPO]in your NativeScript project (for example:tns plugin add ./plugins/nativescript-webrtc-plugin) - Make sure
nativescript-webrtc-plugininpackage.jsonfrom NativeScript project pointed to your local system.
{
...
"dependencies": {
...
"nativescript-webrtc-plugin": "./plugins/nativescript-webrtc-plugin",
...
},
...
}
Now you can run your project again
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 | miladfm |
