UnityのGoogleCardboard用デモをNexus5で動かすまで I made a demo for Google Cardboard work on my Nexus5


It took about 3 days to make a demo work on my Nexus5. The demo is for Google Cardboard on Unity.

My ability is low and I am miserable.

How will I see this message hundreds more time before I can see the cube floating in the air on this smartphone?

I have no idea.... What's going on with GoogleUnityActivity...?

By the way, this article should be useful only around November 15, 2016 writing this now.

A few months later, it will be resolved by official update.

症状 What's happening

I just made progress on what I saw in the official Google document,

Android実機(Nexus 5)に向けてBuildすると、直ちにクラッシュする。
but after building for the Android real machine (Nexus 5), it immediately crashes.

結論 Solution

It is a sudden conclusion. In an article of the type that conveys information like this, it is better to have a conclusion first.

Daydream technical preview を使わない Do Not Use Daydream technical preview

Unity+Google Cardboard開発メモ(Daydream対応) - フレームシンセシス(Japanese website)

As mentioned in this page "However, it seems that there is a problem with the performance on the daydream incompatible terminal at the moment"

Daydream technical preview版のUnityを使ってDaydream非対応端末向けに開発をすると、失敗するようです。
It seems to fail if you develop for daydream incompatible terminals using Daydream technical preview version of Unity.

The method to use the regular version is also included, and it worked out well.

It was okay just to reinstall Unity normally.

試したこと What I tried

Virtual Reality Supported を cardboardだけにする Choose Only "cardboard" in "Virtual Reality Supported"

Build時のPlayer Settingsの中にある「Virtual Reality Supported」という項目です。
It is the item "Virtual Reality Supported" in Player Settings when it is builded.

Daydream technical preview版を使っていると設定できます。
You can choose this if you use Daydream technical preview.

However, it didn't work. Choosing Oculus or Daydream didn't work, neither.

SDKのバージョンを変えてみる Change the version of the SDK

[Unity] アプリをビルドしてandroid実機上でテストする | Unity 3DCG

I intended to do the method that was written on this page ... but I do not know well whether it is effective or not.

It's finally like this.


一度Android Studio用のプロジェクトファイルを書出し、Android Studio経由でビルドする Once you write the project file for Android Studio and build it via Android Studio

Unity CardBoard SDKを使った簡単なVRアプリ開発 in Android | Tech Blog - リクルート住まいカンパニー

Although it is the method written on this page, it does not work.

原因の掘り下げ Drill down on causes

Android Studio とかいうのを使ってエラーメッセージを確認した所、
I confirmed the error message using Android Studio.

java.lang.ClassNotFoundException: Didn't find class "com.google.unity.GoogleUnityActivity"

It's the cause.

The demo I want to make move uses "GoogleUnityActivity",

but Unity of Daydream version uses "UnityPlayerActivity".

Then, it says "I can't find GoogleUnityActivity!!!!"

This is what I found!! That's all!!!

In the meantime, this Demo will correspond to the UnityPlayerActivity. This article will lose value. November 15, 2016