Start a new topic

Problems debuging the NativeScript App on an Android phone

I am getting a System error while I try to debug the NativeScript/Angular/Kinvey App on an Android phone with the "tns run android" command. I am getting the following error messages: System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to start activity ComponentInfo{org.nativescript.blankng/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: Could not resolve app.component.html. Looked for: /data/data/org.nativescript.blankng/files/app/app.component.html. System.err: System.err: StackTrace: System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.blankng/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: Could not resolve app.component.html. Looked for: /data/data/org.nativescript.blankng/files/app/app.component.html. System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed System.err: Error: Could not resolve app.component.html. Looked for: /data/data/org.nativescript.blankng/files/app/app.component.html. System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055) System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19) System.err: at android.app.Activity.performCreate(Activity.java:7327) System.err: at android.app.Activity.performCreate(Activity.java:7318) System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275) System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3101) System.err: ... 11 more

If you need to debug an app locally, remember to start it with "tns debug android" instead of "tns run android". In your case, there seems to be an error during the webpack compilation - check the build logs above this error for any TypeScript/JavaScript errors. Another thing you can try is running "npm install" in the project directory before the run/debug command. This way any missing dependencies, that you might have added or updated, will be installed.

That didn't fix the problem. I am still getting this error message:



JS: HMR: Hot Module Replacement Enabled. Waiting for signal.

System.err: An uncaught Exception occurred on "main" thread.

System.err: Unable to start activity ComponentInfo{org.nativescript.blankng/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed

System.err: Error: Could not resolve app.component.html. Looked for: /data/data/org.nativescript.blankng/files/app/app.component.html.

System.err:

System.err: StackTrace:

System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.blankng/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed

System.err: Error: Could not resolve app.component.html. Looked for: /data/data/org.nativescript.blankng/files/app/app.component.html.

System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984)

System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)

System.err: at android.app.ActivityThread.-wrap14(ActivityThread.java)

System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)

System.err: at android.os.Handler.dispatchMessage(Handler.java:102)

System.err: at android.os.Looper.loop(Looper.java:154)

System.err: at android.app.ActivityThread.main(ActivityThread.java:6776)

System.err: at java.lang.reflect.Method.invoke(Native Method)

System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)

System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)

System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed

System.err: Error: Could not resolve app.component.html. Looked for: /data/data/org.nativescript.blankng/files/app/app.component.html.

System.err: at com.tns.Runtime.callJSMethodNative(Native Method)

System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)

System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)

System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083)

System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063)

System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055)

System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19)

System.err: at android.app.Activity.performCreate(Activity.java:6955)

System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)

System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)

System.err: ... 9 more

Unable to apply changes on device: 3300476f0e8ba3f3. Error is: The application org.nativescript.blankng does not appear to be running on 3300476f0e8ba3f3 or is not built with debugging enabled. Try starting the application manually..

Login or Signup to post a comment