简体   繁体   中英

NativeScript Angular project 'tns run android' gives errors

I created a project using the following command:

ng new -c=@nativescript/schematics project-name --shared

When I run tns run android , I get the following errors:

platforms/android/app/build/intermediates/merged_assets/debug/mergeDebugAssets/out/app/tns_modules/zone.js/lib/zone-spec/long-stack-trace.ts(25,10): error TS2393: Duplicate function implementation.
platforms/android/app/build/intermediates/merged_assets/debug/mergeDebugAssets/out/app/tns_modules/zone.js/lib/zone.ts(632,6): error TS2300: Duplicate identifier 'AmbientZone'.
platforms/android/app/src/main/assets/app/tns_modules/rxjs/src/operator/catch.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/operator/catch'.

These are just sample errors. There are so many of these kind.

I tried;

  • Removing node_modules folder and run npm install
  • Removing platforms/android folder
  • Updating NativeScript(5.1.0) and Angular CLI()
  • Removing /users/username/.gradle folder and let it reinstall
  • Reinstalling Nodejs
  • Installing rxjs-compat which only solves rxjs-compat related errors

Nothing worked so far.

ng --version
  • Angular CLI: 7.2.1+
  • Angular: 7.1.4
  • @angular-devkit/architect 0.12.1 (cli-only)
  • @angular-devkit/core 7.0.7
  • @angular-devkit/schematics 7.0.7
  • @ngtools/webpack 7.1.4
  • @schematics/angular 7.0.7
  • @schematics/update 0.12.1 (cli-only)
  • rxjs 6.3.3
  • typescript 3.1.6
  • webpack 4.27.1

tns --version

5.1.0

Please seethe issue here

Basically, remove the tns_modules folder from platforms/android/app/build/intermediates/merged_assets/debug/mergeDebugAssets/out/app/tns_modules/

It is apparently caused by npm link command I used somewhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM