0

I'm using NativeScript 6.1.1 with Angular 8.0 and I did have the 'tns preview' going at some point, but now when I try to run 'tns preview' and use my Samsung Galaxy S8 (Android 7) I get this error

Successfully sent initial files for platform android.
LOG from device Galaxy S8: com.tns.Runtime.callJSMethodNative(Native Method)
LOG from device Galaxy S8: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
LOG from device Galaxy S8: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1083)
LOG from device Galaxy S8: ERROR Error: Uncaught (in promise): Error: com.tns.NativeScriptException: Failed to find module: "nativescript-angular/http", relative to: app/tns_modules/
LOG from device Galaxy S8: com.tns.Module.resolvePath(Module.java:56)
LOG from device Galaxy S8: com.tns.Module.resolvePathHelper(Module.java:151)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1063)
LOG from device Galaxy S8: com.tns.Runtime.callJSMethod(Runtime.java:1055)
LOG from device Galaxy S8: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:20)
LOG from device Galaxy S8: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
LOG from device Galaxy S8: android.app.Activity.performCreate(Activity.java:6955)
LOG from device Galaxy S8: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
LOG from device Galaxy S8: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
LOG from device Galaxy S8: and...
LOG from device Galaxy S8: android.app.ActivityThread.-wrap14(ActivityThread.java)

I've tried refreshing everything with;

rm -rf node_modules platforms hooks
npm i
tns run android
tns preview

That didn't help. It works in the emulator. I tried to use http-client instead but it wouldn't start. I've updated to the latest packages and that too didn't help.

1 Answer 1

3

As of Angular 8 @angular/http is removed so nativescript-angular/http.

You must migrate to NativeScriptHttpClientModule

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.