xcode - Xcode 运行时崩溃

标签 xcode unity3d exception crash

我运行从 Unity3D 导入的项目。
然后在 XCode 我尝试运行到我的 iPad。

可以构建和安装应用程序,但运行时会崩溃(有时只是空白屏幕)。

在 Xcode 我得到以下错误,但我不明白这些错误是什么意思?

CrashReporter: initialized
2018-10-23 11:11:36.341 flashcards[318:26427] -> registered mono modules 0x1ee2e00
-> applicationDidFinishLaunching()
2018-10-23 11:11:37.789 flashcards[318:26427] Metal GPU Frame Capture Enabled
2018-10-23 11:11:37.790 flashcards[318:26427] Metal API Validation Disabled
-> applicationDidBecomeActive()
Renderer: PowerVR SGX 543
Vendor:   Imagination Technologies
Version:  OpenGL ES 2.0 IMGSGX543-124.1
GLES:     2
GL_OES_depth_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_read_format GL_IMG_texture_comp
ression_pvrtc 
OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level  <OpenGL ES 2.0> ; Context handle 359353072
Initialize engine version: 2017.4.8f1 (5ab7f4878ef1)
WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported
ERROR: 0:38: Use of undeclared identifier 'gl_FragDepthEXT'

Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed.
WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported
ERROR: 0:14: Use of undeclared identifier 'gl_FragDepthEXT'

Note: Creation of internal variant of shader 'Hidden/BlitCopyWithDepth' failed.
WARNING: Shader Unsupported: 'Hidden/BlitCopyWithDepth' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitCopyWithDepth' - Setting to default shader.
The referenced script on this Behaviour (Game Object 'Scene Variables') is missing!

(Filename:  Line: 1758)

The referenced script on this Behaviour (Game Object 'Scene Variables') is missing!

(Filename:  Line: 1758)

The referenced script on this Behaviour (Game Object 'IAPManager') is missing!

(Filename:  Line: 1758)

The referenced script on this Behaviour (Game Object 'IAPManager') is missing!

(Filename:  Line: 1758)

The referenced script on this Behaviour (Game Object 'IAPManager') is missing!

(Filename:  Line: 1758)

UnloadTime: 9.446791 ms
2018-10-23 11:11:45.250 flashcards[318:26427] *** Assertion failure in -[UnityDefaultViewController supportedInterfaceOrientations], /Users/mac/Downloads/snowy_eng_ios_noads/Classes/UI/UnityViewControllerBase+iOS.mm:93
2018-10-23 11:11:48.218 flashcards[318:26427] Uncaught exception: NSInternalInconsistencyException: UnityDefaultViewController should be used only if unity is set to autorotate
(
    0   CoreFoundation                      0x20a37933 <redacted> + 150
    1   libobjc.A.dylib                     0x201d2e17 objc_exception_throw + 38
    2   CoreFoundation                      0x20a377f1 <redacted> + 0
    3   Foundation                          0x2121b529 <redacted> + 92
    4   flashcards                          0x0008849f -[UnityDefaultViewController supportedInterfaceOrientations] + 302
    5   flashcards                          0x000a2ce3 -[UnityAppController application:supportedInterfaceOrientationsForWindow:] + 174
    6   flashcards                          0x0128d0f8 GADiTunesMetadataForFileAtPath + 12068
    7   flashcards                          0x01348570 GADODiskUsageStatisticsWithError + 3488
    8   flashcards                          0x0134848c GADODiskUsageStatisticsWithError + 3260
    9   flashcards                          0x01252f84 GADOCategories_NSArray_GADOJSONAdditions + 15060
    10  flashcards                          0x013112cc GADODispatchAsyncSafeMainQueue + 64
    11  flashcards                          0x01252e40 GADOCategories_NSArray_GADOJSONAdditions + 14736
    12  flashcards                          0x01143531 -[GADURewardBasedVideoAd loadRequest:withAdUnitID:] + 78
    13  flashcards                          0x011403ff GADURequestRewardBasedVideoAd + 76
    14  flashcards                          0x00278c4d RewardBasedVideoAdClient_LoadAd_m483440913 + 34
    15  flashcards                          0x0026c8ab RewardBasedVideoAd_LoadAd_m4208741079 + 90
    16  flashcards                          0x0023bdaf z_reward_ads_Start_m1587933392 + 102
    17  flashcards                          0x010f0ce5 _Z31RuntimeInvoker_Void_t1185182177PFvvEPK10MethodInfoPvPS4_ + 10
    18  flashcards                          0x01d66793 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 118
    19  flashcards                          0x016d91b3 _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 66
    20  flashcards                          0x016dffdd _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 38
    21  flashcards                          0x016e4a73 _ZN13MonoBehaviour30InvokeMethodOrCoroutineCheckedE18ScriptingMethodPtr18ScriptingObjectPtrP21ScriptingExceptionPtr + 1198
    22  flashcards                          0x016e4bd1 _ZN13MonoBehaviour30InvokeMethodOrCoroutineCheckedE18ScriptingMethodPtr18ScriptingObjectPtr + 46
    23  flashcards                          0x016e3f3d _ZN13MonoBehaviour16DelayedStartCallEP6ObjectPv + 46
    24  flashcards                          0x01578339 _ZN18DelayedCallManager6UpdateEi + 430
    25  flashcards                          0x0162b699 _Z10PlayerLoopv + 520
    26  flashcards                          0x0147fb0d _ZL19UnityPlayerLoopImplb + 22
    27  flashcards                          0x000915c5 UnityRepaint + 220
    28  flashcards                          0x0009147d -[UnityAppController(Rendering) repaintDisplayLink] + 76
    29  libMTLInterpose.dylib               0x05cec865 -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 276
    30  QuartzCore                          0x23093a0b <redacted> + 106
    31  QuartzCore                          0x23093857 <redacted> + 594
    32  IOMobileFramebuffer                 0x2277a50b <redacted> + 86
    33  IOKit                               0x20c88759 IODispatchCalloutFromCFMessage + 256
    34  CoreFoundation                      0x209e637d <redacted> + 132
    35  CoreFoundation                      0x209fa5b3 <redacted> + 34
    36  CoreFoundation                      0x209f9cc7 <redacted> + 342
    37  CoreFoundation                      0x209f80d9 <redacted> + 1688
    38  CoreFoundation                      0x20947229 CFRunLoopRunSpecific + 520
    39  CoreFoundation                      0x20947015 CFRunLoopRunInMode + 108
    40  GraphicsServices                    0x21f37ac9 GSEventRunModal + 160
    41  UIKit                               0x2501b189 UIApplicationMain + 144
    42  flashcards                          0x00087f9f main + 206
    43  libdyld.dylib                       0x205ef873 <redacted> + 2

我在这里遇到了异常:
gsCrashReporterUEHandler    NSUncaughtExceptionHandler *    (flashcards`uncaught_exception_handler) 0x01bf1a38

任何想法,我在这里发现了什么错误?

最佳答案

在您的崩溃日志中,我可以看到此错误:
未捕获的异常:NSInternalInconsistencyException:只有在统一设置为自动旋转时才应使用 UnityDefaultViewController。

这意味着 Unity 应将 Screen.orientation 设置为 ScreenOrientation.AutoRotation。

您可以检查 Unity3D 项目中的某些代码是否将 Screen.orientation 设置为任何其他代码并检查“Unity Build setting”默认方向为“Auto Rotation”。

关于xcode - Xcode 运行时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52941116/

相关文章:

c++ - Xcode 中下一次出现的区分大小写选择

c++ - 在 Mac OS X 上将带和不带 RTTI 的库与 GCC 混合使用?

xcode - 为什么我无法下载 Xcode 和 iOS 的最新测试版?

c# - 音乐的音调检测

java - if条件中的空值和空指针异常java

java - db4o 客户端/服务器同步中的复制错误

ios - 在 iOS 应用中使用 AdMob

c# - 准确的捏合缩放

c# - Raycast 如何与 Unity 的 Canvas UI 元素交互?

python - __getitem__/__setitem__ 应该与不受支持的切片步长一起使用哪种异常?