0

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

user1175196
  • 21
  • 1
  • 4
  • Why is there `tns-core-modules` in the Package.json? Remove `tns-core-modules` from Package.json and remove `node_module` after that run `ns clean` and `npm i`. Then try to start the project again. Maybe it's help – miladfm Mar 02 '22 at 18:30
  • Thanks miladfm. if I remove package tns-core-module I am getting below error: ERROR in ./node_modules/nativescript-webrtc-plugin/src/android/TNSRTCMediaDevices.js 3:10-49 Module not found: Error: Can't resolve 'tns-core-modules/application' in 'D:\BeHappy\Android App\BeHappy\node_modules\nativescript-webrtc-plugin\src\android' – user1175196 Mar 03 '22 at 05:04

1 Answers1

0

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:

  1. Clone the nativescript-webrtc repository
  2. Merge the PR with master branch in your local system (see this link to how you can do that: GitHub clone from pull request?)
  3. Run npm run build in clone repository
  4. Run tns plugin remove nativescript-webrtc-plugin in your NativeScript project
  5. Run tns clean in your NativeScript project
  6. Remove node_module folder from your NativeScript project
  7. Run npm i in your NativeScript project
  8. Run tns plugin add [RELATIVE PATH TO CLONE REPO] in your NativeScript project (for example: tns plugin add ./plugins/nativescript-webrtc-plugin)
  9. Make sure nativescript-webrtc-plugin in package.json from NativeScript project pointed to your local system.
{
   ...
   "dependencies": {
    ...
    "nativescript-webrtc-plugin": "./plugins/nativescript-webrtc-plugin",
    ...
   },
   ...
}

Now you can run your project again

miladfm
  • 1,508
  • 12
  • 20
  • Thanks again for your response. I tried cloning the repo but getting auth error as $ git fetch git@github.com:triniwiz/nativescript-webrtc.git refs/pull/61/head git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. – user1175196 Mar 04 '22 at 10:56
  • It's because SSH Authentication, try to clone the repository with HTTPS (`git clone https://github.com/triniwiz/nativescript-webrtc.git`) – miladfm Mar 05 '22 at 09:32
  • Hi @miladfm, i follow your steps on cloning #61 pr into my local and then npm run build. But i got a lots of TS errors such as error TS1110: Type expected, error TS1005: '}' expected, error TS1005: ';' expected. Any ideas what is causing this? – scholarwithfire Dec 05 '22 at 11:06