代码逻辑如下:
1,在未登录状态下,通过其他接口的状态码判断登录状态,在初次未登录状态下跳转登录页(reLaunch跳转VUE页面)
skipSp(x){
if(this.loginStatus == 201){
showToast('请登录')
setTimeout(()=>{
uni.reLaunch({
url:'../login/login'
})
},1000)
}else if(this.loginStatus == 200) {
uni.navigateTo({
url:'../videoplayer/videoplayer?vid='+x.video_vid+"&image="+x.image+"&id="+x.id
})
}
},
2,登录完成后,跳转回首页(switchTab方式)
uni.switchTab({
url: '../index/index'
})
3,进入页面调用,定时器延时调用plus.screen.lockOrientation('landscape');,发生闪退。
setTimeout(()=>{
plus.screen.lockOrientation('landscape');
},500)
4,HX无明显报错,在android studio,使用adb调试,捕获两个异常。若打开应用,在登录状态下进入详情页则不会闪退。
附加ADB输出为ERROR级别信息:
2020-01-09 16:22:06.942 575-575/? E/SELinux: avc: denied { find } for service=phone pid=29526 uid=10013 scontext=u:r:mediaprovider:s0:c512,c768 tcontext=u:object_r:radio_service:s0 tclass=service_manager permissive=0
2020-01-09 16:22:08.054 31749-31749/? E/mabo: B页面1535203211是否启用截图动画方案:false
2020-01-09 16:22:08.054 31749-31749/? E/mabo: B页面是否启用截图动画方案:false | pop-in
2020-01-09 16:22:08.056 31749-31749/? E/mabo: C页面72345841是否启用截图动画方案:false
2020-01-09 16:22:08.064 31749-31749/? E/DHFrameView: ---------------------onAnimationStart
2020-01-09 16:22:08.355 31749-31749/? E/DHFrameView: ---------------------onAnimationEnd
2020-01-09 16:22:08.391 31749-31749/? E/AssistantInput: onCreateInputConnection 00
2020-01-09 16:22:08.407 31749-31749/? E/shutao: new -- JSNWindow=_www/__uniappview.html
2020-01-09 16:22:08.408 31749-31749/? E/DCloud_LOG: createNWindow pUrl=_www/__uniappview.html
2020-01-09 16:22:08.420 31749-31749/? E/DCloud_LOG: createWindow before _url=_www/__uniappview.html
2020-01-09 16:22:08.420 31749-31749/? E/DCloud_LOG: createWindow after _url=_www/__uniappview.html
2020-01-09 16:22:08.433 31749-31749/? E/useTime: name :createFrameView; <<-- createFrameView耗时: -->> useTime = 25
2020-01-09 16:22:08.568 31749-31749/? E/ViewPort: 786
2020-01-09 16:22:08.581 31749-31749/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.houmu.sdsoon.com, PID: 31749
java.lang.NullPointerException: Attempt to invoke interface method 'io.dcloud.common.DHInterface.IApp io.dcloud.common.DHInterface.IFrameView.obtainApp()' on a null object reference
at io.dcloud.common.core.ui.f.obtainApp(DHWebview.java:97)
at io.dcloud.common.adapter.ui.CustomeizedInputConnection.showRecordView(CustomeizedInputConnection.java:92)
at io.dcloud.common.adapter.ui.CustomeizedInputConnection.showRecordView(CustomeizedInputConnection.java:89)
at io.dcloud.common.core.ui.b$b.onSizeChanged(DHAppRootView.java:1586)
at android.view.View.sizeChange(View.java:20902)
at android.view.View.setFrame(View.java:20863)
at android.view.View.layout(View.java:20723)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20726)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20726)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:20726)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:774)
at android.view.View.layout(View.java:20726)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2886)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2413)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1550)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7447)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1065)
at android.view.Choreographer.doCallbacks(Choreographer.java:877)
at android.view.Choreographer.doFrame(Choreographer.java:808)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1051)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
2020-01-09 16:22:08.582 575-575/? E/SELinux: avc: denied { find } for service=miui.mqsas.MQSService pid=31749 uid=10387 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:mqs_service:s0 tclass=service_manager permissive=0
2020-01-09 16:22:08.582 31749-31749/? E/MQSEventManagerDelegate: failed to get MQSService.
2020-01-09 16:22:08.594 1899-1899/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2020-01-09 16:22:08.594 1899-1899/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2020-01-09 16:22:08.594 1899-1899/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2020-01-09 16:22:08.594 1899-1899/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2020-01-09 16:22:08.643 31749-31749/? E/UncaughtExceptionHandler: java.lang.NullPointerException: Attempt to invoke interface method 'io.dcloud.common.DHInterface.IApp io.dcloud.common.DHInterface.IFrameView.obtainApp()' on a null object reference
2020-01-09 16:22:08.650 31772-31779/? E/WeexCore: F:\weex\incubator-weex-19-9-23\incubator-weex-ec1ec238cf03e538e8d07a383befcb5fa2785518\weex_core\Source\android\jsengine\bridge\script\script_bridge_in_multi_process.cpp:72, original owner has die
2020-01-09 16:22:08.683 1705-1802/? E/InputDispatcher: channel 'eb5b4fe com.houmu.sdsoon.com/io.dcloud.PandoraEntryActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2020-01-09 16:22:08.717 1705-1722/? E/libprocessgroup: Error encountered killing process cgroup uid 99516 pid 31847: No such file or directory
2020-01-09 16:22:08.726 1705-1723/? E/KernelWakelockReader: Kernel wake locks exceeded buffer size 49152
2020-01-09 16:22:08.728 1705-1723/? E/BatteryExternalStatsWorker: wifi info is invalid: null
2020-01-09 16:22:08.730 1705-1723/? E/BatteryExternalStatsWorker: modem info is invalid: null
2020-01-09 16:22:08.747 1705-11618/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.miui.home/com.miui.home.launcher.Launcher/41401360
2020-01-09 16:22:08.838 1899-1899/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2020-01-09 16:22:08.838 1899-1899/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2020-01-09 16:22:08.838 1899-1899/? E/MiuiFaceFactory: getCurrentAuthType sCurrentAuthType = 1
2020-01-09 16:22:08.838 1899-1899/? E/MiuiFaceFactory: getFaceManager sCurrentAuthType = 1
2020-01-09 16:22:09.185 29397-29397/? E/Launcher: changeViewByFsGestureState, view=FitSystemWindowView, alpha=1.0, scale=1.0
2020-01-09 16:22:09.185 29397-29397/? E/Launcher: changeViewByFsGestureState, view=ShortcutMenuLayer, alpha=1.0, scale=1.0
2020-01-09 16:22:18.850 1705-1723/? E/KernelWakelockReader: Kernel wake locks exceeded buffer size 49152
2020-01-09 16:22:18.854 1705-1723/? E/BatteryExternalStatsWorker: wifi info is invalid: null
恳请帮忙看下,项目紧急,这里感激不尽。
3 个回复
s***@foxmail.com (作者)
除了plus方法,vido组件全屏操作也会触发。麻烦查下,这个空指针异常那里引起的。
DCloud_Android_ST
sdk版本号说下
s***@foxmail.com (作者)
hbuilder X 2.5.1
2020-01-10 16:35
DCloud_Android_ST
回复 s***@foxmail.com: 下版修复此问题
2020-01-10 16:38
j***@aliyun.com
回复 DCloud_Android_ST: 2.8.2还在闪退
2020-07-29 17:00
DCloud_Android_ST
回复 j***@aliyun.com: 上传复现问题示例demo
2020-07-29 17:25
DCloud_uni-ad_HDX
HBuilderX 2.5.5+ 已修复
j***@aliyun.com
还是会闪退的
2020-07-29 16:57
j***@aliyun.com
2.8.2 还是闪退
2020-07-29 16:59
j***@aliyun.com
nvue 页面横屏之后在执行竖屏 闪退 华为vivo
2020-07-29 17:03