Nativescript无法实例化活动

时间:2017-02-12 23:53:58

标签: android nativescript

我在这里尝试hello world最基本的步骤: https://docs.nativescript.org/tutorial/chapter-1

我已经开始在iOS上工作了旋转苹果,但是当我尝试在Android上启动时,我遇到以下异常。

我可以做些什么来进一步调查或解决?

CLI:2.5.0 跨平台模块:2.5.0 插件:2.5.0

在使用Android 5.0.2的物理设备上运行

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.nativescript.HelloWorld/com.tns.NativeScriptActivity}: java.lang.ClassNotFoundException: Didn't find class "com.tns.NativeScriptActivity" on path: DexPathList[[zip file "/data/app/org.nativescript.HelloWorld-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.HelloWorld-1/lib/arm, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2371)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2522)
at android.app.ActivityThread.access$800(ActivityThread.java:167)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1417)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5537)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tns.NativeScriptActivity" on path: DexPathList[[zip file "/data/app/org.nativescript.HelloWorld-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.HelloWorld-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1070)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2361)
... 10 more
Suppressed: java.lang.ClassNotFoundException: com.tns.NativeScriptActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

1 个答案:

答案 0 :(得分:0)

看起来这是一个错误。请参阅此处的问题和相关讨论: https://github.com/NativeScript/NativeScript/issues/3637