Error: getInternalNameOfClass() called on a non-ES5 class: expected RadListViewComponent to have an inner class declaration - nativescript

I'm using nativescript with angular. After installing nativescript-ui-listview plugin I got this error
Error on worker #1: Error: getInternalNameOfClass() called on a non-ES5 class: expected RadListViewComponent to have an inner class declaration
while running the app.
With a Warning:
Warning: Invalid constructor parameter decorator in C:/Users/rashi/FNFtoursapp/node_modules/nativescript-ui-listview/angular/fesm2015/nativescript-ui-listview-angular.js:
() => [
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
{ type: IterableDiffers, decorators: [{ type: Inject, args: [IterableDiffers,] }] },
{ type: NativeScriptRendererFactory, decorators: [{ type: Inject, args: [NativeScriptRendererFactory,] }] }
]
Need Help
Below is My Package Json File
{
"nativescript": {
"id": "org.nativescript.FNFtoursapp",
"tns-ios": {
"version": "6.5.0"
},
"tns-android": {
"version": "6.5.3"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"scripts": {
"ngcc": "ngcc --properties es2015 module main --first-only",
"postinstall": "npm run ngcc"
},
"dependencies": {
"#angular/animations": "~9.1.0",
"#angular/common": "~9.1.0",
"#angular/compiler": "~9.1.0",
"#angular/core": "~9.1.0",
"#angular/forms": "~9.1.0",
"#angular/platform-browser": "~9.1.0",
"#angular/platform-browser-dynamic": "~9.1.0",
"#angular/router": "~9.1.0",
"#nativescript/angular": "~9.0.0",
"#nativescript/theme": "~2.3.0",
"#nstudio/nativescript-checkbox": "^1.0.0",
"nativescript-cardview": "^3.2.0",
"nativescript-plugin-firebase": "^10.5.2",
"nativescript-ui-listview": "^9.0.2",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.5.0",
"tns-core-modules": "~6.5.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular/compiler-cli": "~9.1.0",
"#ngtools/webpack": "~9.1.0",
"nativescript-dev-webpack": "~1.5.0",
"tns-platform-declarations": "~6.5.0",
"typescript": "~3.8.3"
},
"readme": "NativeScript Application"
}

changing compilerOptions of tsconfig.json from es5 to es2015 works fine with me, you can try

Related

Could not resolve all artifacts for configuration ':classpath'. > Could not resolve io.fabric.tools:gradle:1.26.1

I am building a Nativescript app using nativescript-firebase-plugin. I have the app working on my Windows 10 machine, but wanted to run both Android and IOS at the same time, so I got a Mac and began porting over the app. I went through the docs on how to set it up. tns doctor is returning that everything is OK, but I keep getting the above error when trying to build.
Here is my package.json
{
"nativescript": {
"id": "org.nativescript.myapp",
"tns-ios": {
"version": "6.5.0-2020-02-10-163848-01"
},
"tns-android": {
"version": "6.4.1"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"scripts": {},
"dependencies": {
"#angular/animations": "~8.2.0",
"#angular/common": "~8.2.0",
"#angular/compiler": "~8.2.0",
"#angular/core": "~8.2.0",
"#angular/forms": "~8.2.0",
"#angular/platform-browser": "~8.2.0",
"#angular/platform-browser-dynamic": "~8.2.0",
"#angular/router": "~8.2.0",
"nativescript-angular": "~8.2.0",
"nativescript-imagepicker": "^7.1.0",
"nativescript-plugin-firebase": "^10.3.3",
"nativescript-theme-core": "~1.0.6",
"nativescript-ui-autocomplete": "^6.0.0",
"nativescript-ui-sidedrawer": "^8.0.0",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.4.0",
"tns-core-modules": "^6.4.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular/compiler-cli": "~8.2.0",
"#ngtools/webpack": "8.2.0",
"codelyzer": "~4.5.0",
"nativescript-dev-webpack": "^1.5.0",
"node-sass": "^4.7.1",
"tslint": "~5.19.0",
"typescript": "~3.5.3"
}
}
Here is my firebase.nativescript.json
{
"using_ios": true,
"using_android": true,
"analytics": false,
"firestore": true,
"realtimedb": false,
"authentication": true,
"remote_config": false,
"performance_monitoring": false,
"external_push_client_only": false,
"messaging": false,
"in_app_messaging": false,
"crashlytics": false,
"storage": true,
"functions": false,
"facebook_auth": true,
"google_auth": false,
"admob": false,
"dynamic_links": false,
"ml_kit": false
}
From what I've gathered, it appears this io.fabric.tools has something to do with Google crashlytics, so I made sure to remove it from my firebase plugin and also removed google auth. None of that seemed to make a difference.

SASS compiler failed with exit code 1

I'm following the official getting started with NativeScript/Angular and working on this repo when I do tns run android I get the following:
Executing before-watch hook from /Projects/course-exercise-files-nativescript-angular-getting-started-guide/chapter2/02_07_end/Groceries/hooks/before-watch/nativescript-dev-sass.js
Found peer node-sass
No input file was found.
SASS compiler failed with exit code 1
My node version is: 10.15.1 on a Mac OS Mojave 10.14.2
Here is my package.json :
{
"nativescript": {
"id": "org.nativescript.Groceries",
"tns-android": {
"version": "5.0.0"
},
"tns-ios": {
"version": "5.0.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"#angular/animations": "7.0.0",
"#angular/common": "7.0.0",
"#angular/compiler": "7.0.0",
"#angular/core": "7.0.0",
"#angular/forms": "7.0.0",
"#angular/http": "7.0.0",
"#angular/platform-browser": "7.0.0",
"#angular/platform-browser-dynamic": "7.0.0",
"#angular/router": "7.0.0",
"nativescript-angular": "7.0.0",
"nativescript-theme-core": "1.0.4",
"reflect-metadata": "0.1.10",
"rxjs": "6.3.0",
"tns-core-modules": "5.0.2",
"zone.js": "0.8.4"
},
"devDependencies": {
"#nativescript/schematics": "~0.4.0",
"codelyzer": "~4.5.0",
"nativescript-dev-sass": "~1.6.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "~0.18.0",
"tslint": "~5.11.0",
"typescript": "^3.1.6",
"#angular/compiler-cli": "~7.0.0",
"#ngtools/webpack": "~7.0.0"
},
"readme": "NativeScript Application"
}
I tried many suggestions on other issues discussion but without success.
You will see that error only when you don't have even one SCSS file in your project. Add at least one SCSS file to your project and the error should go away.

Angular 6 Material StaticInjectorError NgZone

After migrating from Angular 5 to Angular 6 all my Material component do not work anymore - again... ...yet this time I am really clueless about what could cause the problem anymore. I invested half a day investigating and created a stripped-down project in order to reproduce the problem in its essence.
Let me show you the various file contents:
package.json
{
"name": "xxx",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "^6.0.9",
"#angular/cdk": "^6.4.0",
"#angular/common": "^6.0.9",
"#angular/compiler": "^6.0.9",
"#angular/core": "^6.0.9",
"#angular/forms": "^6.0.9",
"#angular/http": "^6.0.9",
"#angular/material": "^6.4.0",
"#angular/platform-browser": "^6.0.9",
"#angular/platform-browser-dynamic": "^6.0.9",
"#angular/platform-server": "^6.0.9",
"#angular/router": "^6.0.9",
"#ngtools/webpack": "1.8.0",
"#types/node": "~6.0.60",
"#types/webpack-env": "1.13.0",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.1",
"awesome-typescript-loader": "3.2.1",
"codelyzer": "~3.2.0",
"css": "2.2.1",
"css-loader": "0.28.4",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.9",
"expose-loader": "0.7.3",
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"html-loader": "0.4.5",
"isomorphic-fetch": "2.2.1",
"jquery": "3.2.1",
"json-loader": "0.5.4",
"preboot": "4.5.2",
"protractor": "~5.1.2",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.10",
"rxjs": "^6.2.2",
"style-loader": "0.18.2",
"to-string-loader": "1.1.5",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.7.2",
"url-loader": "0.5.9",
"webpack": "2.5.1",
"webpack-hot-middleware": "2.18.2",
"webpack-merge": "4.1.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"#angular/cli": "^6.0.8",
"#angular/compiler-cli": "^6.0.9",
"#angular/language-service": "^6.0.9",
"#types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0"
}
}
app.module
import { NgModule } from '#angular/core';
import { MatDialogModule } from '#angular/material';
import { CommonModule } from '#angular/common';
import { RouterModule } from '#angular/router';
import { AppComponent } from './components/app/app.component';
import { MessageFormComponent } from './components/common/forms/message.component';
#NgModule({
declarations: [
AppComponent,
MessageFormComponent,
],
imports: [
CommonModule,
MatDialogModule,
RouterModule.forRoot([
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: MessageFormComponent },
{ path: '**', redirectTo: 'home' }
]),
]
})
export class AppModuleShared {
}
message.component.ts
import { Component } from '#angular/core';
import { MatDialog, MAT_DIALOG_DATA } from '#angular/material';
#Component({
selector: 'message-form',
template: 'blubb',
})
export class MessageFormComponent {
constructor(private alert: MatDialog) { } // this line causes the problem
}
As soon as I make ANYTHING with the material - this error occurs. I am good in programming angular programs - not so good in fiddling around with the NEVER WORKING infrastructure... ;-)

Nativescript RadSideDrawer does not show content and app breaks when trying to open the drawer

I have set up the RadSideDrawer as in Telerik documentation. App builds and loads successfully but sidedrawer content is not shown and when trying to swipe the screen to open the sidedrawer application crashes with following error:
An uncaught Exception occurred on "main" thread.
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.FrameLayout.setVisibility(int)' on a null object reference
at com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer.handleOnDown(RadSideDrawer.java:460)
at com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer.onGesture(RadSideDrawer.java:438)
at com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer.onInterceptTouchEvent(RadSideDrawer.java:420)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2109)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2843)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9527)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4248)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4101)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3647)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3700)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3666)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3792)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3674)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3849)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3647)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3700)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3666)
This is package json file:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.app",
"tns-android": {
"version": "3.1.1"
}
},
"dependencies": {
"#angular/animations": "~4.1.0",
"#angular/common": "~4.1.0",
"#angular/compiler": "~4.1.0",
"#angular/core": "~4.1.0",
"#angular/forms": "~4.1.0",
"#angular/http": "~4.1.0",
"#angular/platform-browser": "~4.1.0",
"#angular/router": "~4.1.0",
"moment": "^2.18.1",
"nativescript-angular": "~3.1.0",
"nativescript-cardview": "^2.0.2",
"nativescript-loading-indicator": "^2.3.2",
"nativescript-telerik-ui": "^3.0.4",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.3.0",
"tns-core-modules": "~3.1.0",
"underscore": "^1.8.3",
"zone.js": "~0.8.2"
},
"devDependencies": {
"babel-traverse": "6.25.0",
"babel-types": "6.25.0",
"babylon": "6.17.4",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.5.0",
"tslib": "^1.7.1",
"typescript": "~2.2.1"
}
}
I have installed nativescript-ng2-drawer-seed and it works correctly. I am missing something but i cannot find out. Any help would be appreciated. Thanks
Solved the problem. Just import NativeScriptUISideDrawerModule in the module of the page you are using the sidedrawer. Or just put it in an Angular Shared Module.

Nativescript error: Version strings are not in the same format

I just have installed Nativescript on my macOS Sierra 10.12.12. But when i enter the command: tns platfrom add ios I get the following error message:
*Version strings are not in the same format*
*#platform add*
When I enter the same command for Android everything works fine.
tns doctor gives me the following feedback:
*Your components are up-to-date.*
*No issues were detected.*
Log Trace:
ns platform add ios --log trace > log.txt
Error: Version strings are not in the same format
at Object.versionCompare (/usr/local/lib/node_modules/nativescript/lib/common/helpers.js:111:15)
at /usr/local/lib/node_modules/nativescript/lib/services/ios-project-service.js:92:25
at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:69:47
at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
at .each.platform (/usr/local/lib/nodemodules/nativescript/lib/services/platform-service.js:55:58)
at arrayEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:451:11)
at Function.forEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:8634:14)
#Brad Martin
This is my package.json file:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.HelloWorld",
"nativescript-teststudio-variables": {
"IOS_APP_URL": "telerikmt1"
},
"tns-android": {
"version": "2.5.0"
}
},
"dependencies": {
"#angular/common": "2.4.3",
"#angular/compiler": "2.4.3",
"#angular/core": "2.4.3",
"#angular/forms": "2.4.3",
"#angular/http": "2.4.3",
"#angular/platform-browser": "2.4.3",
"#angular/platform-browser-dynamic": "2.4.3",
"#angular/router": "3.4.3",
"nativescript-angular": "1.4.0",
"nativescript-teststudio": "^1.1.4",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.0.1",
"tns-core-modules": "^2.5.1"
},
"devDependencies": {
"babel-traverse": "6.23.1",
"babel-types": "6.23.0",
"babylon": "6.16.1",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "^0.3.5",
"typescript": "~2.1.0",
"zone.js": "~0.7.2"
}
}

Resources