googlevr / gvr-ios-sdk

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

Using the GVR iOS SDK within a dynamic framework #62

Closed RikHeijdens closed 6 years ago

RikHeijdens commented 8 years ago

We are building an embedded framework on top of the GVR SDK, but we are running into a crash caused by the Google VR SDK.

As soon as we set the vrModeEnabled property on the GVRCardboardView to YES. Our app crashes with the following exception:

2016-06-29 17:33:03.394 MyApp[34501:9374508] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010c6abd85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010c11fdeb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010c6abcbd +[NSException raise:format:] + 205
    3   Foundation                          0x000000010bcc6157 -[NSURL(NSURL) initFileURLWithPath:] + 131
    4   Foundation                          0x000000010bcc60bf +[NSURL(NSURL) fileURLWithPath:] + 45
    5   Framework                           0x000000010b77d7dc -[GVRTransitionView loadView] + 224
    6   Framework                           0x000000010b77d6c5 -[GVRTransitionView initWithFrame:delegate:] + 144
    7   Framework                           0x000000010b773cde -[GVROverlayViewController init] + 162
    8   Framework                           0x000000010b7698fb -[GVRCardboardView presentModal] + 58
    9   Framework                           0x000000010b767eb0 -[GVRCardboardView setVrModeEnabled:] + 203
    10  Framework                           0x000000010b766cc5 -[ViewController setVrModeEnabled:] + 69
    11  Framework                           0x000000010b766c68 -[ViewController didDoubleTapView:] + 88

After a little research it appears that this is happening because the Google VR SDK does not locate it's resources properly. It seems like it only looks for resources in the main bundle, but not in the framework's bundle. We verified this by copying the GVR SDK's bundle resources into the main app in the Copy Bundle Resources build step. In that case the app does not crash.

nathanmartz commented 8 years ago

Thanks for the report. We think this is a legit bug and are working on a fix.

justsomeguy-google-com commented 8 years ago

Just to clarify, you are embedding our bundle into your bundle, so our bundle is no longer in [NSBundle mainBundle]

RikHeijdens commented 8 years ago

That's correct.

Our project is setup like this:

Where Framework is a dynamic embedded library within App. The Framework target builds against the GVRSDK (through CocoaPods).

Our goal is to have the ability to distribute the Framework without the app to other developers.

RikHeijdens commented 8 years ago

We upgraded to v0.9.0 and now we're getting the following error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithFormat:locale:arguments:]: nil argument'

The Cardboard SDK bundle is present in the framework.

justsomeguy-google-com commented 8 years ago

I'll need to a copy of either your project or something else that repros the problem. I thought I had this fixed but I obviously didn't duplicate what you are seeing right.

ronenwevr commented 8 years ago

Hello, we are running to the same issue. I can send you a test project I was using. It is very bare bones, and probably does not work. But definitely reproduces the crash. Is there a private channel for me to submit it to you?

RikHeijdens commented 8 years ago

@justsomeguy-google-com I could create a variant on TreasureHunt that exposes this problem, can I email it to the address listed in your GitHub user profile?

justsomeguy-google-com commented 8 years ago

We think we found it. It was the same problem as before but for strings.

On Mon, Aug 22, 2016 at 3:12 AM, Rik Heijdens notifications@github.com wrote:

@justsomeguy-google-com https://github.com/justsomeguy-google-com I could create a variant on TreasureHunt that exposes this problem, can I email it to the address listed in your GitHub user profile?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlevr/gvr-ios-sdk/issues/62#issuecomment-241331228, or mute the thread https://github.com/notifications/unsubscribe-auth/AIu4EtVrMEPZPnbriBQQiBb110B9ie7iks5qiUvrgaJpZM4JB_7O .

RikHeijdens commented 8 years ago

Cool, please let me know if we should test a build in order to confirm that the problem has been solved.

vivianlys90 commented 8 years ago

Hi, any updates on this issue?

justsomeguy-google-com commented 8 years ago

I found the issue and believe I have a fix. Not sure when we are pushing a new release.

On Tue, Sep 20, 2016 at 2:24 AM, vivianL notifications@github.com wrote:

Hi, any updates on this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlevr/gvr-ios-sdk/issues/62#issuecomment-248249830, or mute the thread https://github.com/notifications/unsubscribe-auth/AIu4Ejcq3JhdWEiYwo0GLPPir2TvHTQqks5qr6ZTgaJpZM4JB_7O .

mortocks commented 8 years ago

same issue - any update on when a new version will be pushed out (our problem is conflicts with the Wikitude framework)

nathanmartz commented 8 years ago

The fix for this will likely go live with our next SDK release, timing is still TBD.

mstana commented 7 years ago

@nathanmartz I would like to kindly ask you if there is any progress with this issue #62

Thank You

nathanmartz commented 7 years ago

Looks like we'll have it wrapped up in a few more weeks, definitely before the end of the year.

RikHeijdens commented 7 years ago

@nathanmartz Was this fixed with the 1.10 release? I don't see it being mentioned in the release notes, will there be more releases before the end of the year?

sanjayc77 commented 6 years ago

Closing this bug since the issue was fixed about a year ago. Re-open if the issue is still present.