New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GvrSettings and GvrCardboardHelpers on ios should use [DllImport("__Internal")] #622

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@peterept
Copy link

peterept commented Jun 19, 2017

I discovered this whilst trying to use GvrCardboardHelpers.SetViewerProfile().

Issue: #621

The current SDK code 1.6 on both IOS and Android is using DLLImport("gvr"). This is incorrect, IOS should be using "__Internal" to call into the GVRSDK which is an embedded library.

With this fix you can correctly call SetViewerProfile.

To repro:

  • Create a new project in Unity 5.6.1f1
  • In Build Settings switch the platform to IOS
  • In Project Settings set a bundle id. Also Enable VR, and add Cardboard only
  • Import the Unity GVR 1.6 SDK
  • Load the demo scene
  • Add the following file:
TestCardboard.cs:

using System.Collections;
using UnityEngine;

public class TestCardboard : MonoBehaviour {
	void Awake() {
		Debug.Log ("Setting default viewer");
		GvrCardboardHelpers.SetViewerProfile ("http://google.com/cardboard/cfg?p=CgZHb29nbGUSEkNhcmRib2FyZCBJL08gMjAxNR0rGBU9JQHegj0qEAAASEIAAEhCAABIQgAASEJYADUpXA89OggeZnc-Ej6aPlAAYAM");
	}
}
  • Create an empty game object in the scene and add that script
  • In Build Settings, add this scene to the build
  • Build
  • In finder open the XCode Workspace for the project just build
  • PLAY onto your connected iOS Device
  • We are now running in GoogleVR split screen mode
  • Press the Google VR Settings Button

Expected:

  • settings says the viewer is "2015 Cardboard Viewer V2"

Actual:

  • Settings didn't get our new profile, it says it is the default cardboard viewer.
  • In XCode console log we see DllNotFoundException: Unable to load DLL 'gvr': The specified module could not be found.

Now, take this fix and re-run. We now see the viewer is updated.

@googlebot

This comment has been minimized.

Copy link

googlebot commented Jun 19, 2017

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.
@peterept

This comment has been minimized.

Copy link
Author

peterept commented Jun 19, 2017

@peterept

This comment has been minimized.

Copy link
Author

peterept commented Jun 27, 2017

Update: One downside of this fix is that appears to break on Unity Cloud builds. The linker can't resolve the references. It works fine on local builds.

@googlebot

This comment has been minimized.

Copy link

googlebot commented Jun 27, 2017

CLAs look good, thanks!

@otri

This comment has been minimized.

Copy link

otri commented Aug 12, 2017

Thanks @peterept!
@miraleung please integrate this pull request, it's the single blocker left for anyone doing iOS builds. Issue is still present in GoogleVR 1.70 release and master branch.

@rusmaxham

This comment has been minimized.

Copy link
Contributor

rusmaxham commented Aug 14, 2017

I'm taking over as lead on the GVR Unity SDK from miraleung. I'm getting this integrated now.

@otri

This comment has been minimized.

Copy link

otri commented Aug 15, 2017

Wonderful, thank you @rusmaxham. Say hello to @miraleung for me!

@fredsa fredsa added the bug label Sep 20, 2017

@fredsa

This comment has been minimized.

Copy link
Member

fredsa commented Sep 20, 2017

Thanks for PR. Confirmed that the bug exists in the current 1.70 SDK .
This should be fixed in an upcoming release.

@fredsa

This comment has been minimized.

Copy link
Member

fredsa commented Sep 29, 2017

Closing this PR, but leaving related issue #621 open.

@fredsa

This comment has been minimized.

Copy link
Member

fredsa commented Oct 7, 2017

Fixed in v1.100.

@fredsa fredsa closed this Oct 7, 2017

@divAxe

This comment has been minimized.

Copy link

divAxe commented Dec 15, 2017

Hello Sir, I am not able to make it work for me. The view just wont change even when SetViewerProfile() returns true. Can you please tell me what I might be missing? Thank you.

@Derojo

This comment has been minimized.

Copy link

Derojo commented Feb 1, 2018

Same issue, SetViewerProfile doesn't seem to do anything. Neither on Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment