我有我的 android 应用程序,点击即可打开统一播放器。我的统一播放器按预期执行。
问题:在更改屏幕旋转时,应用程序崩溃。
调试控制台输出:
I/Unity: StopVuforia
(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
D/AR: RenderManager: Could not retrieve a valid GLSurfaceView in view hierarchy, therefore cannot set any render mode
W/MessageQueue: Handler (android.os.Handler) {90dbee5} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {90dbee5} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.sendMessage(Handler.java:519)
at android.os.Message.sendToTarget(Message.java:416)
at com.unity3d.player.UnityPlayer$e.a(Unknown Source)
at com.unity3d.player.UnityPlayer$e.b(Unknown Source)
at com.unity3d.player.UnityPlayer.b(Unknown Source)
at com.unity3d.player.UnityPlayer.a(Unknown Source)
at com.unity3d.player.UnityPlayer.a(Unknown Source)
at com.unity3d.player.UnityPlayer$17.surfaceDestroyed(Unknown Source)
at android.view.SurfaceView.updateWindow(SurfaceView.java:588)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:247)
at android.view.View.dispatchDetachedFromWindow(View.java:15567)
at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:4914)
at android.view.ViewGroup.removeAllViews(ViewGroup.java:4860)
at com.unity3d.player.UnityPlayer.quit(Unknown Source)
at com.Accenture.Activity.UnityPlayerActivity.onDestroy(UnityPlayerActivity.java:66)
at android.app.Activity.performDestroy(Activity.java:6889)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1175)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4231)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4262)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4536)
at android.app.ActivityThread.-wrap19(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
W/MessageQueue: Handler (android.os.Handler) {90dbee5} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {90dbee5} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.sendMessage(Handler.java:519)
at android.os.Message.sendToTarget(Message.java:416)
at com.unity3d.player.UnityPlayer$e.b(Unknown Source)
at com.unity3d.player.UnityPlayer.b(Unknown Source)
at com.unity3d.player.UnityPlayer.a(Unknown Source)
at com.unity3d.player.UnityPlayer.a(Unknown Source)
at com.unity3d.player.UnityPlayer$17.surfaceDestroyed(Unknown Source)
at android.view.SurfaceView.updateWindow(SurfaceView.java:588)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:247)
at android.view.View.dispatchDetachedFromWindow(View.java:15567)
at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:4914)
at android.view.ViewGroup.removeAllViews(ViewGroup.java:4860)
at com.unity3d.player.UnityPlayer.quit(Unknown Source)
at com.Accenture.Activity.UnityPlayerActivity.onDestroy(UnityPlayerActivity.java:66)
at android.app.Activity.performDestroy(Activity.java:6889)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1175)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4231)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4262)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4536)
at android.app.ActivityThread.-wrap19(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
W/Unity: Timeout while trying detaching primary window.
AndroidManifest
<activity
android:name=".UnityPlayerActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="landscape"
android:theme="@style/UnityThemeSelector">
<meta-data
android:name="unityplayer.UnityActivity"
android:value="true" />
</activity>
解决方法:
“修复屏幕更改应用程序崩溃”或“强制横向视图”将使我的解决方案。
- 我尝试将统一播放器设置更改为横向左侧。
- 我试过
orientation|layoutDirection|screenLayout
从 android 清单文件中删除我的。 - 我试过添加
screenOrientation="landscape/user/nosensor/fulluser"