googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
647 stars 191 forks source link

crash in gvr::PlatformInfo::GetApplicationName() when instantiating GVRCardboardView #168

Closed deeje closed 7 years ago

deeje commented 7 years ago

Hi,

I am able to get GVRSDK iOS sample code to run on device, but am hitting a roadblock in my project. After instantiating a GVRCardboardView, it crashes deep inside setVRModeEnabled…

self.cardboardView = [[GVRCardboardView alloc] initWithFrame:stageFrame]; self.cardboardView.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; self.cardboardView.delegate = self; self.cardboardView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.cardboardView.vrModeEnabled = YES;

EXC_BAD_ACCESS (code=1, address=0x0)

Thread 1 Queue : com.apple.main-thread (serial)

0 0x0000000180da504c in strlen ()

1 0x00000001003f8154 in gvr::PlatformInfo::GetApplicationName() const ()

2 0x00000001003bbb24 in gvr::ServerLogger::BuildLogEvent(wireless_android_play_playlog::VREvent_EventType const&, std::__1::shared_ptr) ()

3 0x00000001003bc5e0 in gvr::ServerLogger::Log(wireless_android_play_playlog::VREvent_EventType const&, std::__1::shared_ptr) ()

4 0x00000001003bc4e0 in gvr::ServerLogger::Log(wireless_android_play_playlog::VREvent_EventType const&) ()

5 0x0000000100391808 in gvr::CardboardApiImpl::CardboardApiImpl(gvr::DisplayMetrics const&, std::__1::shared_ptr, std::__1::shared_ptr<gvr::SingleTypeEventProducer >, gvr::CardboardApiImpl::Detectors) ()

6 0x00000001003912f8 in gvr::CardboardApiImpl::Create() ()

7 0x0000000100391298 in gvr::CardboardApi::Create() ()

8 0x0000000100275734 in +[GVRDeviceParamsHelper viewerModelName] ()

9 0x0000000100284f78 in -[GVRTransitionView loadView] ()

10 0x00000001002847d4 in -[GVRTransitionView initWithFrame:delegate:] ()

11 0x000000010027c170 in -[GVROverlayViewController init] ()

12 0x0000000100272cfc in -[GVRCardboardView presentModal] ()

13 0x00000001002718e4 in -[GVRCardboardView setVrModeEnabled:] ()

14 0x000000010016cc44 in -[SCNStageViewController viewDidLoad] at /Users/deeje/Documents/tapprtv-ios/Classes/SCNStageViewController.m:82

Does this ring a bell for anyone?

sanjayc77 commented 7 years ago

Is this in the iOS Simulator or iOS Device?

deeje commented 7 years ago

on an iPhone 6 running iOS 9.3.5

skycenter commented 7 years ago

@deeje can you share your source code?

deeje commented 7 years ago

@skycenter :-|

contact me directly?

deeje commented 7 years ago

if I don't set vrModeEnabled = true, I still crash the first time thru calling Render

0 0x0000000180da504c in strlen ()

1 0x0000000100467624 in gvr::PlatformInfo::GetApplicationName() const ()

2 0x000000010042aff4 in gvr::ServerLogger::BuildLogEvent(wireless_android_play_playlog::VREvent_EventType const&, std::__1::shared_ptr) ()

3 0x000000010042bab0 in gvr::ServerLogger::Log(wireless_android_play_playlog::VREvent_EventType const&, std::__1::shared_ptr) ()

4 0x000000010042b9b0 in gvr::ServerLogger::Log(wireless_android_play_playlog::VREvent_EventType const&) ()

5 0x0000000100400cd8 in gvr::CardboardApiImpl::CardboardApiImpl(gvr::DisplayMetrics const&, std::__1::shared_ptr, std::__1::shared_ptr<gvr::SingleTypeEventProducer >, gvr::CardboardApiImpl::Detectors) ()

6 0x0000000100400884 in gvr::CardboardApiImpl::Create(gvr::DisplayMetrics const&) ()

7 0x00000001002e1568 in -[GVRCardboardView initCardboardApi] ()

8 0x00000001002e0fcc in -[GVRCardboardView render:] ()

9 0x00000001013bcaa0 in -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] ()

10 0x0000000183e3422c in CA::Display::DisplayLinkItem::dispatch() ()

11 0x0000000183e340e0 in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()

12 0x0000000181571e54 in IODispatchCalloutFromCFMessage ()

13 0x0000000181299030 in __CFMachPortPerform ()

14 0x00000001812b17d4 in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION ()

15 0x00000001812b0f0c in __CFRunLoopDoSource1 ()

16 0x00000001812aec64 in __CFRunLoopRun ()

17 0x00000001811d8c50 in CFRunLoopRunSpecific ()

18 0x00000001812263a4 in CFRunLoopRun ()

19 0x00000001001e7394 in -[CardboardRenderLoop threadMain] at /Users/deeje/Documents/tapprtv-ios/Classes/CardboardRenderLoop.m:90

skycenter commented 7 years ago

@deeje just emailed you

sanjayc77 commented 7 years ago

The gvr::PlatformInfo::GetApplicationName() is constructed from: [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey] UTF8String].

Can you make sure this returns a bundle name properly?

deeje commented 7 years ago

OK, that fixed it. Any reason why you're using that key rather than kCFBundleDisplayNameKey?