Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by callumlk00 · May 03, 2017 at 07:38 AM · androidvrandroid buildpluginsbuild error

GoogleVR - Cardboard + Android build error

Using the GoogleVR SDK, I have created a very basic scene in Unity, involving a 'recticle' that changes the color of a cube when the user hovers over it. This works completely as expected in play mode, however, when I build it to android and run it on my device (Motorola G4 - Android 7.0) I observed some strange behavior. Usually, the recticle would expand when it is over the cube but, on my device, this doesn't happen and instead it works when the recticle is offset to the left of the cube. Why is this happening?

The only thing that I have changed that could've possibly caused this is deleting the /Assets/Plugins/Android folder as I had to do this to enable to project to build because Unity was "unable to convert classes into dex format", meaning that multiple classes with the same name existed. (I'm not sure why and I couldn't find any other matching classes, but deleting the folder seemed to fix the issue)

Thanks in advance, - Callum

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Liinnkk · May 05, 2017 at 01:17 PM

Are you using Unity 5.6? If yes, your problem can be the native compatibility with Google Cardboard implemented in Unity 5.6.

If you downloaded Cardboard SDK from https://developers.google.com/vr/unity/ and you're using Unity 5.6 version, then this "strange behavior" you talk may be just some conflicts between the Unity's Cardboard Native Support and the Google's External SDK.

This happens because when you play your game in Editor Mode, you're playing in PC plataform, which ISN'T affected by Unity's Cardboard Native Support — here only Google's External SDK is working. And when you build your app for Android and play the game on your Smartphone, you're playing on Android's plataform, which IS affected by native support and by Google's External SDK at the same time, what could generate some those strange behaviours when you port the game for android.

So here are the facts:

  • Since 5.6, you MUST enable Virtual Reality Support and select Cardboard or Daydream.

  • And if you want to emulate VR in Editor or use another feature exclusive to Google's External SDK (see https://developers.google.com/vr/unity/), then you should add Cardboard SDK as well.

Since my case is similar to yours, but I'm not facing any problem, I'll give you some idea of my hierarchy (Android/Cardboard). With Virtual Reality Supported enabled and Cardboard listed in the Player Settings, I have the following Gvr objects in my scene:

GvrViewerMain: with the 'GvrViewer' script.

GvrReticlePointer: as a child of my 'Main Camera , with the 'GvrReticlePointer' script.

EventSystem: with GvrPointerManager and GvrPointerInputModule scripts. Remember to Disable the Standalone Input Module here.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image callumlk00 · May 09, 2017 at 05:02 PM 0
Share

@Liinnkk Ok, thanks, that makes sense but how would I go about disabling/removing one of them? I've tried deleting the external SD$$anonymous$$ but that doesn't work seeing as the project uses prefabs and scripts etc. that are included in it. I also tried disabling the 'Virtual Reality Supported" button under the Player Settings because I thought this might have something to do with the "Native Support" that you mentioned, this got rid of the weird plugin errors I had before and the game built without any errors but when I installed it on my smartphone It failed, saying the file was corrupt. What would be the best way for me to use only one of the approaches?

avatar image Liinnkk callumlk00 · May 10, 2017 at 03:37 AM 1
Share

@callumlk00 Hmm... actually, it depends on how you've developed your project so far. But I have done some research and I found that the Google SD$$anonymous$$ was updated and some drastic changes were made. For my understanding now, you must check the Support Virtual Reality under the Player Settings and select Google Cardboard or Daydream. So now Native Support is not optional as I told you before — my bad. Actually, using Unity's Cardboard Native Support and Google SD$$anonymous$$ (which is now implemented to work aside native support) is a good approach, specially because Google SD$$anonymous$$ let you emulate Virtual Reality through mouse and keyboard, allowing you to test your VR game in Editor's Play $$anonymous$$ode.

So here are the facts:

  • You $$anonymous$$UST enable Virtual Reality Support and select Cardboard or Daydream.

  • If you want to emulate VR in Editor, you should add Cardboard SD$$anonymous$$ as well.

Since my case is similar to yours, but I'm not facing any problem, I'll give you some idea of my hierarchy (Android/Cardboard). With Virtual Reality Supported enabled and Cardboard listed in the Player Settings, I have the following Gvr objects in my scene:

  • GvrViewer$$anonymous$$ain: with the 'GvrViewer' script.

  • GvrReticlePointer: as a child of my '$$anonymous$$ain Camera , with the 'GvrReticlePointer' script.

  • EventSystem: with GvrPointer$$anonymous$$anager and GvrPointerInput$$anonymous$$odule scripts. Remember to Disable the Standalone Input $$anonymous$$odule here.

I'll update my answer as soon as we discover what's causing your problem.

avatar image callumlk00 Liinnkk · May 10, 2017 at 03:59 PM 0
Share

Okay... $$anonymous$$anaged to sort it out: I created a new blank project to recreate the hierarchy you described and in doing so I installed the latest version of the Google VR SD$$anonymous$$.

I loaded one of the demo scenes and built it and then ran it on my android device. This seemed to fix the issue and now everything works just fine.

Thanks for the help!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Can a project tiny app be built for android? 1 Answer

Gradle build error 0 Answers

Google Cardboard VR Project Says Pixel Phone is Not Compatible Device 1 Answer

why unity not resolving aar and jar files 0 Answers

Too many method references; max is 65536. 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges