_From @alereisan on March 13, 2018 15:9_
Yes
Since I upgraded to the latest tns version 3.4.3 i can't run my app on Android anymore - Sidekick asked me to upgrade. I have deleted the folders /hooks, /platforms and /node_modules as well as package-lock.json, did tns platform remove android & readded it, but still this error occurs.
The app works on iOS, and has worked on Android before the upgrade.
Console output when I run "tns run android":
`Searching for devices...
Executing before-liveSync hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\before-liveSync\nativescript-angular-sync.js
Executing before-prepare hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\before-prepare\nativescript-dev-sass.js
Found peer node-sass
Executing before-prepare hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 2.6.2
Preparing project...
Executing before-prepareJSApp hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\before-prepareJSApp\nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\after-prepare\nativescript-dev-sass.js
All SASS source files removed from app package
Executing after-prepare hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\after-prepare\nativescript-dev-webpack.js
Installing...
Successfully installed on device with identifier 'emulator-5554'.
Successfully transferred all files.
Refreshing application...
Successfully synced application ch.inaffect.hcm on device emulator-5554.
Executing before-watch hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\before-watch\nativescript-dev-sass.js
Found peer node-sass
Executing before-watch hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.6.2
ActivityManager: Start proc 4691:ch.inaffect.hcm/u0a84 for activity ch.inaffect.hcm/com.tns.NativeScriptActivity
15:57:20 - Compilation complete. Watching for file changes.JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE. 4600
JS: ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: "./login/login.module", relative to: app//
JS: com.tns.Module.resolvePathHelper(Module.java:146)
JS: com.tns.Module.resolvePath(Module.java:55)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
JS: com.tns.Runtime.callJSMethod(Runtime.java:957)
JS: com.tns.Runtime.callJSMethod(Runtime.java:941)
JS: com.tns.Runtime.callJSMethod(Runtime.java:933)
JS: com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:44)
JS: android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
JS: android.app.Activity.performStart(Activity.java:6696)
JS: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2628)
JS: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
JS: android.app.ActivityThread.-wrap12(ActivityThread.java)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:154)
JS: android.app.ActivityThread.main(ActivityThread.java:6119)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
JS: Error: com.tns.NativeScriptException: Failed to find module: "./login/login.module", relative to: app//
JS: com.tns.Module.resolvePathHelper(Module.java:146)
JS: com.tns.Module.resolvePath(Module.java:55)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
JS: com.tns.Runtime.callJSMethod(Runtime.java:957)
JS: com.tns.Runtime.callJSMethod(Runtime.java:941)
JS: com.tns.Runtime.callJSMethod(Runtime.java:933)
JS: com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:44)
JS: android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
JS: android.app.Activity.performStart(Activity.java:6696)
JS: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2628)
JS: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
JS: android.app.ActivityThread.-wrap12(ActivityThread.java)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:154)
JS: android.app.ActivityThread.main(ActivityThread.java:6119)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
JS: at require (:1:266)
JS: at file:///data/data/ch.inaffect.hcm/files/app/tns_modules/tns-core-modules/globals/globals.js:92:32
JS: at new ZoneAwarePromise (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:777:29)
JS: at Object.import (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/tns-core-modules/globals/globals.js:90:16)
JS: at SystemJsNgModuleLoader.loadAndCompile (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/@angular/core/bundles/core.umd.js:6592:29)
JS: at SystemJsNgModuleLoader.load (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/@angular/core/bundles/core.umd.js:6576:60)
JS: at RouterConfigLoader.loadModuleFactory (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/@angular/router/bundles/router.umd.js:4565:72)
JS: at RouterConfigLoader.load (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/@angular/router/bundles/router.umd.js:4545:52)
JS: at MergeMapSubscriber.project (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/@angular/router/bundles/router.umd.js:2037:74)
JS: at MergeMapSubscriber._tryNext (file:///data/data/ch.inaffect.
JS: hcm/files/app/tns_modules/rxjs/operators/mergeMap.js:122:27)
JS: at MergeMapSubscriber._next (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/rxjs/operators/mergeMap.js:112:18)
JS: at MergeMapSubscriber.Subscriber.next (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/rxjs/Subscriber.js:90:18)
JS: at ScalarObservable._subscribe (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/rxjs/observable/ScalarObservable.js:49:24)
JS: at ScalarObservable.Observable._trySubscribe (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/rxjs/Observable.js:172:25)
JS: at ScalarObservable.Observable.subscribe (file:///data/data/ch.inaffect.hcm/files/app/tns_modules/rxjs/Observable.js:160:93)
Executing after-watch hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\after-watch\nativescript-dev-sass.js
Stopping sass watch
Executing after-watch hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\after-watch\nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\after-watch\nativescript-dev-sass.js
Executing after-watch hook from C:\Users\Alessandro\nodejs\nativescript\ns-hcm-rating\HCM-Rating\hooks\after-watch\nativescript-dev-typescript.js`
The file app/login/login.module.ts exists:
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptFormsModule } from "nativescript-angular/forms";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";import { LoginRoutingModule } from "./login-routing.module";
import { LoginComponent } from "./login.component";import { UserService } from "../services/user.service";
@NgModule({
imports: [
NativeScriptModule,
LoginRoutingModule,
NativeScriptFormsModule
],
declarations: [
LoginComponent
],
schemas: [
NO_ERRORS_SCHEMA
],
providers: [
UserService
]
})
export class LoginModule { }
Android
{
"description": "App for HCM",
"license": "SEE LICENSE IN",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "ch.inaffect.hcm",
"tns-ios": {
"version": "3.4.1"
},
"tns-android": {
"version": "3.4.2"
}
},
"scripts": {
"lint": "tslint \"app/*/.ts\""
},
"dependencies": {
"@angular/animations": "~5.2.0",
"@angular/common": "~5.2.0",
"@angular/compiler": "~5.2.0",
"@angular/core": "~5.2.0",
"@angular/forms": "~5.2.0",
"@angular/http": "~5.2.0",
"@angular/platform-browser": "~5.2.0",
"@angular/platform-browser-dynamic": "~5.2.0",
"@angular/router": "~5.2.0",
"nativescript-angular": "~5.2.0",
"nativescript-iqkeyboardmanager": "1.2.0",
"nativescript-materialdropdownlist": "1.0.15",
"nativescript-pro-ui": "~3.3.0",
"nativescript-ripple": "2.0.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-toast": "1.4.6",
"reflect-metadata": "~0.1.10",
"rxjs": "~5.5.5",
"tns-core-modules": "^3.4.1",
"zone.js": "~0.8.18"
},
"devDependencies": {
"@angular/compiler-cli": "~5.2.0",
"@ngtools/webpack": "~1.9.4",
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"codelyzer": "~4.0.2",
"copy-webpack-plugin": "~4.3.0",
"css-loader": "~0.28.7",
"extract-text-webpack-plugin": "~3.0.2",
"lazy": "1.0.11",
"nativescript-dev-sass": "~1.3.5",
"nativescript-dev-typescript": "~0.6.0",
"nativescript-dev-webpack": "~0.9.1",
"nativescript-worker-loader": "~0.8.1",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.2.1",
"sass-loader": "~6.0.6",
"tslint": "~5.8.0",
"typescript": "~2.6.2",
"uglifyjs-webpack-plugin": "~1.1.6",
"webpack": "~3.10.0",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-sources": "~1.1.0"
},
"author": "Alessandro Santamaria"
}
_Copied from original issue: NativeScript/NativeScript#5532_
HI @alereisan,
Thank you for contacting us,
I tested your case while using the provided info. However, we were unable to recreate this problem.
Regarding that, please provide more info about the steps, which you follow, while building the project. Also, it would help if you send us the projector sample one, which could be used for debugging.
Hi @tsonevn I invited you to the github repository
@tsonevn I just created a fresh nativescript-angular project and I get the same error as written above
There must be a problem with my machine (out of the blue, as it worked before I upgraded Nativescript following this instructions ).
I started the new project with Nativescript Sidekick:
Hi @alereisan,
Thank you for providing me access to the project.
After I reviewed the code, I found that the case is related to the
capital letter L in the name of the login folder and the files in it.
To solve the case you should rename Login folder ->login,
as well as
Login-routing.module.ts ->login-routing.module.ts,
Login.component.ts ->login.component.ts,
Login.component.html ->login.component.html,
Login.module.ts ->login.module.ts.
Also, make sure to delete all JavaScript files from the login folder and remove the platform with tns platform remove android. Then try again to rebuild the project.
The same problem and solution for me, @tsonevn
Thank you
The same issues here, all "l" is lower case, but still not working:
ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: "./login.component", relative to: app/app/login/
[it's default auth application created with sidekick]
Hi @borasik,
Try to clear up the project. Check out the steps below:
node_modules, platforms, hooks folders and package-lock.json filenpm iI was getting the same error until I changed folder names to not use underscore.
eg. I changed _components to components, etc..
tns run android now works
@johnayling I'm getting this same issue, and my path is ../_lib/getTimezoneOffsetInMilliseconds/index.js"
Most helpful comment
Hi @alereisan,
Thank you for providing me access to the project.
After I reviewed the code, I found that the case is related to the
capital letter
Lin the name of the login folder and the files in it.To solve the case you should rename
Loginfolder ->login,as well as
Login-routing.module.ts->login-routing.module.ts,Login.component.ts->login.component.ts,Login.component.html->login.component.html,Login.module.ts->login.module.ts.Also, make sure to delete all JavaScript files from the
loginfolder and remove the platform withtns platform remove android. Then try again to rebuild the project.