nativescript-vue/nativescript-vue.org

java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:

34658768 opened this issue · 2 comments

error info :

Successfully synced application com.im.zlpopo on device emulator-5554.
ActivityManager: Start proc 8758:com.im.zlpopo/u0a67 for activity com.im.zlpopo/com.tns.NativeScriptActivity
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException:
System.err: Cannot compile /data/data/com.im.zlpopo/files/app/main.js
System.err: SyntaxError: Unexpected identifier
System.err: File: "file:///data/data/com.im.zlpopo/files/app/main.js, line: 1, column: 67
System.err: StackTrace:
System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
System.err: SyntaxError: Unexpected identifier
System.err: File: ", line: 1, column: 265
System.err: StackTrace:
System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
System.err: at android.app.ActivityThread.-wrap1(ActivityThread.java)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: at android.os.Looper.loop(Looper.java:148)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5417)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Cannot compile /data/data/com.im.zlpopo/files/app/main.js
System.err: SyntaxError: Unexpected identifier
System.err: File: "file:///data/data/com.im.zlpopo/files/app/main.js, line: 1, column: 67
System.err: StackTrace:
System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
System.err: SyntaxError: Unexpected identifier
System.err: File: ", line: 1, column: 265
System.err: StackTrace:
System.err: Frame: function:‘require’, file:’’, line: 1, column: 266
System.err: at com.tns.Runtime.runModule(Native Method)
System.err: at com.tns.Runtime.runModule(Runtime.java:553)
System.err: at com.tns.Runtime.run(Runtime.java:545)
System.err: at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
System.err: … 8 more
ActivityManager: Process com.im.zlpopo (pid 8758) has died

image

https://discourse-cdn-sjc2.com/standard14/uploads/nativescript/original/2X/5/54de36d8cbed39bb5cb93d2183e6bfceb675ee70.png

Issue should be in https://github.com/nativescript-vue/vue-cli-template

But the problem seems like you are not passing --bundle to the run command:

tns run android --bundle

@rigor789 you have provided the solution for me