Help me get Daydream working on Unity? :O

Hi guyyyys

I've been trying like heck to get Daydream working in Unity and my Macbook, my goodness it's not easy.

I'm running 5.6 Beta, and so followed these instructions: https://developers.google.com/vr/unity/get-started

I've followed every step and now I'm stuck on an error getting the Daydream controller emulator working in Unity itself, and it seems like I'm stuck on this error:

"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've googled far and wide, and I found this thread which proposes that this would make it work "adding the PATH before starting Unity 5.6 seems to recognize the controller emulator fine when starting the in-game testing.":
https://forum.unity3d.com/threads/5-6-0b3-linux-daydream-controller-emulator-wont-work-adb-command-not-found.451423/

But I have no idea what that actually means... Anyone know?

Comments

  • I don't have Unity installed here (lol), but I remember a setting in the Unity editor for telling it where your Android SDK is installed, in case you haven't done that yet. I don't know if things have changed since I last built to Android years ago though.
  • I don't have Unity installed here (lol), but I remember a setting in the Unity editor for telling it where your Android SDK is installed, in case you haven't done that yet. I don't know if things have changed since I last built to Android years ago though.
    I got Android Studio 2.3, which I assume has SDK 24 because Daydream needs it, but I can't find *anywhere* that states so or not. And also I can't get any other SDK from the official site, so I assume that's it. And yeah I set the folders. The funny thing is that there *is* an adb file in that folder but in \platform-tools, and I can't use/set to that folder. Soooo I'm stuck there.
  • Can you copy the adb.exe (or whatever its executable is called) into the main SDK folder and see if that works?
  • edited
    Can you copy the adb.exe (or whatever its executable is called) into the main SDK folder and see if that works?
    Lol no that didn't work :)

    Here's the full error though, hope this makes some sense to someone :/

    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.
    at Gvr.Internal.EmulatorClientSocket.setupPortForwarding (Int32 port) [0x000b3] in /Volumes/TU_media/game_dev/_experimental/DaydreamTest4/ddtest4/Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs:141
    at Gvr.Internal.EmulatorClientSocket.phoneConnect () [0x00039] in /Volumes/TU_media/game_dev/_experimental/DaydreamTest4/ddtest4/Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs:86
    at Gvr.Internal.EmulatorClientSocket.phoneEventSocketLoop () [0x00017] in /Volumes/TU_media/game_dev/_experimental/DaydreamTest4/ddtest4/Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs:62
    UnityEngine.Debug:LogWarningFormat(String, Object[])
    Gvr.Internal.EmulatorClientSocket:phoneEventSocketLoop() (at Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs:65)
  • edited
    Oh... have you added the adb folder to your PATH?

    On Windows 7, it's Control Panel > System > Advanced System Settings > Advanced tab > Environment Variables...

    Scroll down System variables to "Path" or "PATH", and change that value. You want to keep it the same as it was, but add the folder path that contains your adb.exe, separated by a semicolon. Be careful changing this, as stuffing it up could affect your computer elsewhere. <_<

    Dunno how it works on a Mac, if that's what you're using.
  • edited
    ... I have no idea how to do that... I just googled it, and found that if I open terminal and do echo $PATH I get this:

    /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/pathToTheAndroidSdkFolder/android-sdk-mac_86/platform-tools

    That last bit looks kind of right but also very wrong - "pathToTheAndroidSdkFolder" doesn't look like it can be the right thing at all, and I'm not entirely sure how to fix that... Any terminal-savvy peeps here? :/

    /Users/steventu/Library/Android/sdk/platform-tools

    The above is the path I need to get in, I assume that "usr" somehow translates into "/Users/steventu/"?
  • This seems pretty good? Dunno if it's up-to-date for whatever your version of MacOS is.
    http://architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.WMck8zvysuV ?

    The colons seem to separate each entry.
    Thanked by 1Tuism
  • Did you get sorted with this @Tuism?
  • This seems pretty good? Dunno if it's up-to-date for whatever your version of MacOS is.
    http://architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.WMck8zvysuV ?

    The colons seem to separate each entry.
    I followed it and got different results :/

    sudo nano /etc/paths gets me this:
    image

    echo $PATH gets me this:
    image

    The last line is different. But they should be the same. Also I have no idea if I should be using "usr" instead of "users/steventu"........

    @Thelangfordian no I haven't got it sorted yet >_<
    Screen Shot 2017-03-14 at 9.54.00 AM.png
    569 x 99 - 17K
    Screen Shot 2017-03-14 at 9.54.20 AM.png
    571 x 342 - 29K
  • Did you restart your laptop, or log out and in again after making the path change?
    Thanked by 1Tuism
  • Did you restart your laptop, or log out and in again after making the path change?
    Doh! Okay so I restarted and it's in echo $PATH... But the error in unity persists :/ I don't know if the path is wrong or if there's another bug somewhere...

    is adding /Users/steventu/Library/Android/sdk/platform-tools correct? Assuming default settings? I notice that everything else is "usr" instead of the full "users/steventu", does that matter?

    Here's my echo $PATH now:
    image
    That very last line seems to have been added by the android sdk or something, but it doesn't look right, or is it right?
    Screen Shot 2017-03-14 at 10.06.54 AM.png
    570 x 61 - 18K
  • Why is the last path still there, the "/pathToTheAndroidSdkFolder/android-sdk-mac_86/platform-tools"?

    I would suggest navigating to the platform-tools folder in your terminal. Type pwd, and it will print the full path, and make sure that the path is correct. If not, use the pwd path that is printed out.

    Check your /etc/paths file for that last error path and make sure it is not there, if it is delete it, and make sure it is only your platform-tools path that is added.

    If the above doesn't work then there is a different way to fix this, which is the way I add android stuff to my path.
  • Oh, did you add anything to your .bashrc file? I see it was mentioned in your first link.
  • edited
    Ahhhhh D:

    I followed what you said, did the pwd, and copy pasted that into the path file (the only difference was a capital letter on "user"), restarted my machine and it still didn't work, same adb error :(

    Oh and that last entry is still there, I assume, because the android sdk adds it on startup, I think. Whether it's right or not right I have *no* idea.

    And no, I don't know what you mean by adding something to .bashrc file... I have no idea how to do that so no :P

    In that first link they mentioned that running Unity from terminal seems to make it work... I dunno how to do that, I tried cd applications/unity and it's not there, I assume there's something I don't understand about the osx file structure and that "Macintosh HD/applications/unity" is a thing I don't know how to get to...
    Screen Shot 2017-03-14 at 11.36.27 AM.png
    570 x 85 - 20K
  • Damn, I am not too sure how to continue without seeing the stuffs in front of me.
    If you want we can arrange a Teamviewer session or a meetup and I can try and help out?
  • Damn, I am not too sure how to continue without seeing the stuffs in front of me.
    If you want we can arrange a Teamviewer session or a meetup and I can try and help out?
    Thanks man! Let's perhaps give that a shot, maybe later, I'll be at Wits this evening!
  • Okay... Some progress... If I run unity from terminal (open -a unity\ 56\ beta) (that last bit is because I've renamed my installation), THE CONTROLLER WORKS.

    But not if I run it from my task bar...... Some progress... At least...
  • edited
    ffffFFFFFFFF D:

    Daydream controller emulation works in Editor as long as I launch from Terminal.
    Now I'm having trouble building to APK.

    Context, I'm running:
    Unity 5.6 beta
    OSX
    Android Studio 2.3 (latest as far as I know)

    When I build to APK it throws this error:
    Build failure
    Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. See the Console for details.
    In Console:
    CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/steventu/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -

    stderr[
    Error:Invalid command android
    ]
    stdout[

    ]
    exit code: 64
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.HostView:OnGUI()
    The Android SDK path is set, I'm certain. In fact if I deviate from "/Users/steventu/Library/Android/sdk" it actually doesn't continue to build and asks me for the sdk path until that one is put in.

    I'm not sure if I have the LATEST Android SDK version - I know Daydream requires Android SDK 24, I read that somewhere, but I can't find any download that SAYS Android SDK 24 OFFICIALLY. I googled and found a bunch of SDK 24 and SDK 25 downloads from non-official sites and they look suspect. On the official site all I can get to is Android Studio, which DOESN'T TELL ME SHIT ABOUT THE VERSION.

    I know it says it's an android sdk error, but could it be a misdiagnosed Java error? My jdk folder setting points to "/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/", does that look right?

    I AM GOING NUTS PLZ HALP THANKS >_<
  • edited
    I think you need to add the tools directory to your path as well.
    /tools is in the same level as the /platform-tools directory, so in your case, the tools folder should be
    /users/steventu/library/android/sdk/tools

    You should also make sure you have the right stuff installed in the SDK Manager.
    In Android Studio at the welcome screen, click Configure at the bottom right, then SDK Manager in the drop down.

    You need to make sure to have the right Android stuff installed, I have placed arrows in screenshots below what I think you need to install. (You can ignore the rest, leave it to whatever it is on your system, this is a screenshot of my ADB setup)

    Imgur page with pics
    image
    image

    I hope this helps...
    Thanked by 1Tuism
  • @Thelangfordian thanks for these!! I jumped the gun a bit before you uploaded the pics and grabbed 7.1.1/API 25, thank you for showing me THIS THING I would NEVER have known its existence otherwise (the documentation SUCKSSSS).

    But it still won't build, with the same error, do I need 7.0 AS WELL AS 7.1.1? I'm going to get it now anyway to see. But to your experience, do you need both?
  • @Tuism
    The Daydream documentation says 24 minimum, so API 25 should work, but I would grab API 24 just in case.
    Ensure the other downloads (arrows in images above) are up to date.

    If that still doesn't work then I would need to actually be on the computer myself to see what's going on.
  • edited
    @Thelangfordian So... I got everything, and it still doesn't work :( WTF UNITY WTF GOOGLE WTF WTF

    I've rebooted, I've done everything I know that could matter, this is what my screenies look like now:

    image
    image

    Siiiiiigh D:
    Screen Shot 2017-03-15 at 12.45.33 PM.png
    1003 x 672 - 195K
    Screen Shot 2017-03-15 at 12.45.52 PM.png
    1005 x 750 - 196K
  • Oooookay, so fortunately someone from unity saw a thread of mine and jumped in, seems like their bug and they're working on a fix, in the meantime I need to downgrade my sdk tools. Here's the post:

    https://forum.unity3d.com/threads/5-6-beta-daydream-osx-apk-build-failing.461156/#post-2994387

    The build is going YAY :D
Sign In or Register to comment.