我正在使用{N} 2.0.1开发一款应用 然而,当我在Android模拟器(geny motion)上运行应用程序时,几分钟后,它只是崩溃了这个堆栈跟踪:
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethodNative(Native Method)
I/dalvikvm( 5042): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethod(Runtime.java:712)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethod(Runtime.java:693)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethod(Runtime.java:683)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethodNative(Native Method)
I/dalvikvm( 5042): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethod(Runtime.java:712)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethod(Runtime.java:693)
I/dalvikvm( 5042): at com.tns.Runtime.callJSMethod(Runtime.java:683)
我只是在Android模拟器上观察到这种行为。在iOS模拟器或Android物理设备上,我还没有遇到过它。 这是与模拟器相关的东西还是我的代码导致这一点? 如果有人之前有这个错误,一些见解会很棒!
修改
即使在Android模拟器上也会出现错误。 具体来说,在我导航到我的自定义选项卡视图实现之后。 这是我实现它的方式 main.xml中
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="loaded"
xmlns:t1="partial-views/explore"
xmlns:t2="partial-views/community">
<ActionBar title="Haloose">
</ActionBar>
<StackLayout>
<StackLayout verticalAlignment="center" horizontalAlignment="center" id="sl_main">
<t1:explore id="explore" visibility="{{ currentActive == 'explore' ? 'visible' : 'collapsed' }}" />
<t2:community id="community" visibility="{{ currentActive == 'community' ? 'visible' : 'collapsed' }}"/> />
</StackLayout>
<StackLayout id="sl_menu" orientation="horizontal">
<Image src="{{ currentActive == 'explore' ? '~/img/icon-green/icon-explore.png' : '~/img/icon-gray/icon-explore.png' }}" class="menuimage" tap="loadexplore"/>
<Image src="{{ currentActive == 'community' ? '~/img/icon-green/icon-community.png' : '~/img/icon-gray/icon-community.png' }}" class="menuimage" tap="loadcommunity"/>
</StackLayout>
</StackLayout>
</Page>
这是从android设备监视器看到的输出
05-25 09:50:53.188: D/dalvikvm(2170): GC_FOR_ALLOC freed 1309K, 5% free 31388K/32812K, paused 47ms, total 47ms
05-25 09:50:53.198: A/libc(2170): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=128), thread 2170 (escript.haloose)
05-25 09:50:53.298: I/DEBUG(1122): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-25 09:50:53.298: I/DEBUG(1122): Build fingerprint: 'generic_x86/sdk_x86/generic_x86:4.4.2/KK/2872501:eng/test-keys'
05-25 09:50:53.298: I/DEBUG(1122): Revision: '0'
05-25 09:50:53.298: I/DEBUG(1122): pid: 2170, tid: 2170, name: escript.haloose >>> org.nativescript.haloose <<<
05-25 09:50:53.298: I/DEBUG(1122): signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 00000000
05-25 09:50:53.528: I/DEBUG(1122): eax b89d52e0 ebx a72d0cbc ecx 000003fc edx b8497b68
05-25 09:50:53.528: I/DEBUG(1122): esi b8496b70 edi 000003fe
05-25 09:50:53.528: I/DEBUG(1122): xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b
05-25 09:50:53.528: I/DEBUG(1122): eip a6c398e9 ebp b8497b68 esp bfb2402c flags 00210282
05-25 09:50:53.528: E/Corkscrew(1122): unrecognized dwarf higher part encoding: 0xeb
05-25 09:50:53.528: I/DEBUG(1122): backtrace:
05-25 09:50:53.528: I/DEBUG(1122): #00 pc 0038f8e9 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::HandleScope::DeleteExtensions(v8::internal::Isolate*)+265)
05-25 09:50:53.528: I/DEBUG(1122): #01 pc 002a3086 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::HandleScope::~HandleScope()+70)
05-25 09:50:53.528: I/DEBUG(1122): #02 pc 0024a377 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (Java_com_tns_Runtime_callJSMethodNative+231)
05-25 09:50:53.528: I/DEBUG(1122): stack:
05-25 09:50:53.528: I/DEBUG(1122): bfb23fec b846b6c0 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb23ff0 bfb23fe7 [stack]
05-25 09:50:53.528: I/DEBUG(1122): bfb23ff4 bfb23fe0 [stack]
05-25 09:50:53.528: I/DEBUG(1122): bfb23ff8 a705c4d4 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::base::Thread::SetThreadLocal(int, void*)+36)
05-25 09:50:53.528: I/DEBUG(1122): bfb23ffc 0000001a
05-25 09:50:53.528: I/DEBUG(1122): bfb24000 b8471e40 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24004 a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): bfb24008 a6d2c1a4 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread()+116)
05-25 09:50:53.528: I/DEBUG(1122): bfb2400c a72d531c
05-25 09:50:53.528: I/DEBUG(1122): bfb24010 a705c4b6 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::base::Thread::SetThreadLocal(int, void*)+6)
05-25 09:50:53.528: I/DEBUG(1122): bfb24014 a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): bfb24018 a6d2c47c /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::Isolate::SetIsolateThreadLocals(v8::internal::Isolate*, v8::internal::Isolate::PerIsolateThreadData*)+60)
05-25 09:50:53.528: I/DEBUG(1122): bfb2401c 0000001a
05-25 09:50:53.528: I/DEBUG(1122): bfb24020 b8471e40 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24024 a6d2c139 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread()+9)
05-25 09:50:53.528: I/DEBUG(1122): bfb24028 a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): #00 bfb2402c b89d52e0 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24030 a6d2c446 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::Isolate::SetIsolateThreadLocals(v8::internal::Isolate*, v8::internal::Isolate::PerIsolateThreadData*)+6)
05-25 09:50:53.528: I/DEBUG(1122): bfb24034 a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): bfb24038 a6d2d876 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::Isolate::Enter()+118)
05-25 09:50:53.528: I/DEBUG(1122): bfb2403c 00000000
05-25 09:50:53.528: I/DEBUG(1122): bfb24040 b8471e40 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24044 30b7d555
05-25 09:50:53.528: I/DEBUG(1122): bfb24048 00000000
05-25 09:50:53.528: I/DEBUG(1122): bfb2404c 30b88b9d
05-25 09:50:53.528: I/DEBUG(1122): bfb24050 b8478a40 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24054 000003fc
05-25 09:50:53.528: I/DEBUG(1122): bfb24058 00000000
05-25 09:50:53.528: I/DEBUG(1122): bfb2405c a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): bfb24060 b846b6c0 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24064 a6c397e9 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::HandleScope::DeleteExtensions(v8::internal::Isolate*)+9)
05-25 09:50:53.528: I/DEBUG(1122): bfb24068 a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): ........ ........
05-25 09:50:53.528: I/DEBUG(1122): #01 bfb2407c b846b6c0 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24080 a6e07d47 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::internal::Runtime_DebugPopPromise(int, v8::internal::Object**, v8::internal::Isolate*)+7)
05-25 09:50:53.528: I/DEBUG(1122): bfb24084 a6af8f31 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (tns::Runtime::CallJSMethodNative(_JNIEnv*, _jobject*, int, _jstring*, int, unsigned char, _jobjectArray*)+17)
05-25 09:50:53.528: I/DEBUG(1122): bfb24088 a6b4d048 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (v8::HandleScope::~HandleScope()+8)
05-25 09:50:53.528: I/DEBUG(1122): bfb2408c a72d0cbc /data/app-lib/org.nativescript.haloose-2/libNativeScript.so
05-25 09:50:53.528: I/DEBUG(1122): bfb24090 d1800035
05-25 09:50:53.528: I/DEBUG(1122): bfb24094 b846b6c0 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb24098 a6af4378 /data/app-lib/org.nativescript.haloose-2/libNativeScript.so (Java_com_tns_Runtime_callJSMethodNative+232)
05-25 09:50:53.528: I/DEBUG(1122): bfb2409c bfb240e8 [stack]
05-25 09:50:53.528: I/DEBUG(1122): bfb240a0 b8305da0 [heap]
05-25 09:50:53.528: I/DEBUG(1122): bfb240a4 3ea00025
05-25 09:50:53.528: I/DEBUG(1122): bfb240a8 00001b0e
05-25 09:50:53.528: I/DEBUG(1122): bfb240ac c0e00029
05-25 09:50:53.528: I/DEBUG(1122): bfb240b0 00000000
05-25 09:50:53.528: I/DEBUG(1122): bfb240b4 00000000
05-25 09:50:53.528: I/DEBUG(1122): bfb240b8 f780002d
05-25 09:50:53.528: I/DEBUG(1122): --------- beginning of /dev/log/system
05-25 09:50:53.608: W/ActivityManager(1545): Force finishing activity org.nativescript.haloose/com.tns.NativeScriptActivity
05-25 09:50:53.608: D/gralloc(1124): Registering a buffer in the process that created it. This may cause memory ordering problems.
05-25 09:50:53.608: E/libEGL(1124): called unimplemented OpenGL ES API
05-25 09:50:53.608: E/libEGL(1124): called unimplemented OpenGL ES API
05-25 09:50:53.608: E/libEGL(1124): called unimplemented OpenGL ES API
05-25 09:50:53.608: E/libEGL(1124): called unimplemented OpenGL ES API
05-25 09:50:53.608: E/SurfaceFlinger(1124): glCheckFramebufferStatusOES error 2073286530
05-25 09:50:53.608: E/SurfaceFlinger(1124): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
05-25 09:50:53.608: E/libEGL(1124): called unimplemented OpenGL ES API
05-25 09:50:53.608: E/libEGL(1124): called unimplemented OpenGL ES API
05-25 09:50:53.618: W/WindowManager(1545): Screenshot failure taking screenshot for (328x546) to layer 21010
05-25 09:50:53.628: D/Zygote(1125): Process 2170 terminated by signal (11)
05-25 09:50:53.628: W/InputDispatcher(1545): channel 'b12805d0 org.nativescript.haloose/com.tns.NativeScriptActivity (server)' ~ Consumer closed input channel or an error occurred. events=0xd
05-25 09:50:53.638: E/InputDispatcher(1545): channel 'b12805d0 org.nativescript.haloose/com.tns.NativeScriptActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-25 09:50:53.638: I/ActivityManager(1545): Process org.nativescript.haloose (pid 2170) has died.
05-25 09:50:53.648: W/InputDispatcher(1545): Attempted to unregister already unregistered input channel 'b12805d0 org.nativescript.haloose/com.tns.NativeScriptActivity (server)'
05-25 09:50:53.648: I/WindowState(1545): WIN DEATH: Window{b12805d0 u0 org.nativescript.haloose/com.tns.NativeScriptActivity}