Vue 2.0 Android template error on initial launch


#1

Really frustrated by this issue when trying to run the Vue 2.0 template on Android.

Anyone able to help me understand what could be wrong, please?

error:

Successfully synced application com.nvalanda.com on device emulator-5554.
ActivityManager: Start proc com.nvalanda.com for activity com.nvalanda.com/com.tns.NativeScriptActivity: pid=2938 uid=10058 gids={50058, 3003, 1028, 1015}
System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 
System.err: Error calling module function 
System.err: Error calling module function 
System.err: Error: java.lang.ClassNotFoundException: com.tns.NativeScriptActivity
System.err:     java.lang.Class.classForName(Native Method)
System.err:     java.lang.Class.forName(Class.java:251)
System.err:     java.lang.Class.forName(Class.java:216)
System.err:     com.tns.Runtime.getClassForName(Runtime.java:1036)
System.err:     com.tns.ClassResolver.resolveClass(ClassResolver.java:27)
System.err:     com.tns.Runtime.resolveClass(Runtime.java:604)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:553)
System.err:     com.tns.Runtime.run(Runtime.java:545)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:135)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:136)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5017)
System.err:     java.lang.reflect.Method.invokeNative(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:515)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
System.err:     dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: java.lang.NoClassDefFoundError: com/tns/NativeScriptActivity
System.err:     java.lang.Class.classForName(Native Method)
System.err:     java.lang.Class.forName(Class.java:251)
System.err:     java.lang.Class.forName(Class.java:216)
System.err:     com.tns.Runtime.getClassForName(Runtime.java:1036)
System.err:     com.tns.ClassResolver.resolveClass(ClassResolver.java:27)
System.err:     com.tns.Runtime.resolveClass(Runtime.java:604)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:553)
System.err:     com.tns.Runtime.run(Runtime.java:545)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:135)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:136)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5017)
System.err:     java.lang.reflect.Method.invokeNative(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:515)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
System.err:     dalvik.system.NativeStart.main(Native Method)```

#2

Did you modify the manifest file or have a custom application class?


#3

Thanks. I started again and running an Android app on a connected device now works.

I think my problem may have also been related to using Sidekick and changing some of the Android properties there. Do you know if we will ever be able to set the Min / Max SDK versions for Android or would doing so break everything as I seem to have done here? Will the min SDK API version 22 and mean that older Android phones will not work with NativeScript Vue?

Thanks again for your help.


#4

You can update min and max API level only within the range that NativeScript supports.

NativeScript supports API level 17 and above as mentioned in the docs. API level 22 is the minimum complier SDK, don’t get confused with that.

There are only less than 2% of devices in market still running below 17.


#5

Thanks again.

Takes me back to my original problem as I want to change the API version to 19 and this obviously changes the manifest file and causes the app to fail with the error above. Do you know how I can change the API version without the app failing with this error please?


#6

Just updating the API level should not cause the above issue, at least I can confirm it works on my end. Make sure your syntaxes are correct.