0

I am trying to run tns preview/tns run ios -bundle on my iPhone XS Max using Nativescript Sidekick. In Nativescript Playground I am able to scan the QR code and preview the nativescript angular application. I don't understand why I have so many errors on my side. Visit https://play.nativescript.org/?template=play-ng&id=kfKgN2&v=383 to see the nativescript angular code work on the Nativescript Playground. After I download the template and open the app using Nativescript Sidekick, I confirm that my project is up to date with {N} 6.0, I run tns doctor, and everything is good. Any tns preview or tns run command I initiate gives me the exact same results- error codes.

Google is simply running out of suggestions for me to fix this. I am sure this is an easy fix and I didn't want to bother anyone but I just can't figure it out. I have tried:

https://docs.nativescript.org/performance-optimizations/bundling-with-webpack https://docs.nativescript.org/tooling/docs-cli/project/configuration/platform-update https://www.npmjs.com/package/nativescript-pro-ui (depreciated) http://docs.telerik.com/devtools/nativescript-ui/migration I have uninstalled and installed the node_modules, platforms, and Nativescript cli.

npm cache verify

I found this issue from 2017 https://github.com/angular/angular-cli/issues/7078 but it doesn't exactly match my errors. Because I don't have at least 10 reputation I am unable to post more than 8 links. I deleted about 10 more links of all the things I have researched and tried.

Download the {N} Angular code from the Nativescript Playground, as posted above, open Nativescript Sidekick, run tns run ios --bundle and tns preview --bundle the same errors happen for tns run android --bundle

I would love to preview my app except I get a page full of these errors.

ERROR in app/nativescript-ui-sidedrawer/platforms/android/typings/sidedrawer.d.ts(521,129): error TS2694: Namespace 'android.support' has no exported member 'v7'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(60,36): error TS2552: Cannot find name 'TKView'. Did you mean 'MTKView'?
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(108,9): error TS2304: Cannot find name 'TKTheme'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(175,48): error TS2304: Cannot find name 'TKTheme'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(224,42): error TS2552: Cannot find name 'TKView'. Did you mean 'MTKView'?
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(254,18): error TS2304: Cannot find name 'TKFill'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(256,18): error TS2304: Cannot find name 'TKCoreStackLayout'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(322,45): error TS2304: Cannot find name 'TKStyleNode'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(330,8): error TS2304: Cannot find name 'TKFill'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(336,18): error TS2304: Cannot find name 'TKFill'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(338,10): error TS2304: Cannot find name 'TKStroke'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(386,41): error TS2304: Cannot find name 'TKStyleNode'.
app/nativescript-ui-sidedrawer/platforms/ios/typings/sidedrawer.d.ts(632,18): error TS2304: Cannot find name 'TKCoreStackLayout'.
node_modules/nativescript-vue/index.d.ts(3,37): error TS2307: Cannot find module 'vue/types/vue'.
Narendra
  • 4,514
  • 2
  • 21
  • 38
Shastina
  • 1
  • 2
  • Did you include the typings files in your `references.d.ts`? – Manoj Aug 03 '19 at 18:23
  • No I don't think so. But on my path to finding a solution I found this https://www.nativescript.org/blog/support-for-androidx-in-nativescript and thought this would solve my problem. I followed all steps, went to run tns preview --bundle. Error= "Could not migrate the project! The error is: Error: Command npm failed with exit code 1" even though I had already migrated it. this is the error that i was trying to fix = public constructor(param0: com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer, param1: globalAndroid.support.v7.widget.Toolbar); – Shastina Aug 04 '19 at 08:16
  • Probably a little bit late but who knows. Which version of nateivescript-ui-sidedrawer do you use? could you paste your references.d.ts? – phenric Oct 06 '20 at 17:44

2 Answers2

0

I was able to resolve the issue just by updating the the platform:

tns platform update android
FrontEnd-er
  • 661
  • 4
  • 13
0

I know it's old but in case other people encounter this issue here's what helped me.

Make sure your tsconfig.json contains "skipLibCheck": true that appear to be coming in by default if you're generating a new project.

Below is an example of my tsconfig file:

{
  "compilerOptions": {
    "module": "esnext",
    "target": "es2017",
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "noEmitHelpers": true,
    "noEmitOnError": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": [
      "es2017",
      "dom"
    ],
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "src/*"
      ]
    }
  },
  "exclude": [
    "node_modules",
    "platforms"
  ]
}