I’m having issues after upgrading to the latest Unity. I’m trying to compile the Google Cardboard demo scene for iPhone. I’ve gone through the basic set up documentation and when trying to build am getting the following errors:
Instant Preview requires your Unity Android SDK path to be set. Please set it under Preferences/External Tools/Android. You may need to install the Android SDK first.
UnityEngine.Debug:LogError(Object)
InstantPreviewHelper:Awake() (at Assets/GoogleVR/Scripts/InstantPreview/InstantPreviewHelper.cs:35)
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)
Error building Player: Instant Preview requires your Unity Android SDK path to be set. Please set it under Preferences/External Tools/Android. You may need to install the Android SDK first.
Build completed with a result of ‘Failed’
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00207] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:172
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:83
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)
I don’t understand why Unity is asking me to set my Android SDK, and where it says I can set it there is no option to, as I’m building for iOS. Any ideas?
Okay - in my case, the error was happening because I had a stray “Using UnityEditor” in one of my source files. When I switched to a PC build, it yelled at me. I removed the offending statement, and now I can also build for Android and iOS. Would’ve been cool if the error had bubbled up for the Android builder.
I’ve just finished building my first VR app for iOS.
The character movement code was
if (Input.GetKeyDown(KeyCode.mouse0) etc.
it worked fine so I could test in editor mode as the gvr isn’t supported:
“VRDevice cardboard not supported in Editor Mode. Please run on target device.”
Now it’s finished and the code is switched to
if (GvrEditorEmulator.Instance.Triggered)
to allow me to use the magnetic switch in cardboard, Unity simply won’t build & run. I get a message in my console saying
Android Debug Bridge (adb) command not found.
“Verify that the Android SDK is installed and that the directory containing adb is included in your PATH environment variable.”
I haven’t gone near android files as I’ve an iPhone and Macbook!
I can switch the code back and forth and it builds straight away using the mouse click input code and once again the GvrEditorEmulator nulls the build attempt. I just get the degrading Mac dud tone and it cancels all actions.
Build completed with a result of ‘Failed’
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00207] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:172
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:83
UnityEngine.GUIUtility: processEvent(Int32, IntPtr)
I had the same problem when I tried to build an app. I was using unity 2017.2.1f1
I solved the problem by changing the tools in the sdk folder with the tools_r25.2.5 - Download this file online here - Android SDK Offline: Android SDK Tools/Manager
First just rename the tools folder already present in sdk root folder with toolsXXXX and then
Unzip tools_r25.2.5 and copy its tools into the sdk root folder.
download java kit 8u161 and then in Edit->Preferences ->External Tools
Set these jdk1.8 path and sdk path
It worked for me after that and I built my first app using Unity 3d
I hope it works for you too.
OMG… I never would have figured that you couldn’t bypass the sdk. the source code is there… but yes, maybe it’s better to just add the android sdk to avoid changing the source code. good find @Ankshil
@Ankshil said you installed android sdk “tools_r25.2.5” by “changing the tools in the sdk folder”. Did you already have an older version of android sdk installed? What sdk folder are you referring to?
It’s actually much simpler in IOS case. Just remove the the “GvrInstantPreviewMain” object from your hierarchy. In case you do not want to use the instant preview app.