Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Build for Gear VR is not working anymore...

Discussion in 'AR/VR (XR) Discussion' started by Mumford-and-Dragons, Nov 21, 2016.

  1. Mumford-and-Dragons

    Mumford-and-Dragons

    Joined:
    Jan 5, 2016
    Posts:
    129
    So about 2 months ago me and a teacher followed a tutorial named "Creating a Gear VR app in Unity Free" on YouTube. We got it working, and I was able to build a Unity project and put it on the Samsung Galaxy S7 to work on the Gear VR.
    So...a week after I got it working on my main project, I built another small project, copied the necessary files over to the new Unity project folders; 'project settings files (17 files in total)', and the 'oculussig' (within assets>plugins>android>assets. And again it worked, I built it on the phone and had it working on the Gear VR. Unity was able to locate where the SDK file was stored on my PC aswell.

    Now the problem. I did the exact same method, making a new project for my 3rd year of University, and copying over the correct files. All of a sudden it wont build on my phone. It gets built as an .apk, but it doesnt even ask me to plug in the phone when its being built (something it did a few months ago). I updated Android Studio, Unity is fine, triple checked the settings, changed the 'product and company name', and nothing seems to be fixing it. I even drag the .apk file onto the phone but nothing...

    I have spend this whole day ripping my hair out, trying to find a solution but I cant. Which is why I plead for help on here lol. Does anyone know why I cant seem to build correctly.

    P.S I even tried building the old Unity files that were working before, trying to build them again today with different names but nothing. I have no clue, was something changed or updated with Unity or Samsung? Is it easy to fix?

    . Untitled-1.jpg
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Clutching at some straws here based on the post:

    So it's actually building the APK fine? Is this the same phone as the other 2 times and could you need a new oculussig file? Have you by chance checked the android logcat output when you try to install the application?
     
  3. Mumford-and-Dragons

    Mumford-and-Dragons

    Joined:
    Jan 5, 2016
    Posts:
    129
    Yes its building the .apk file. And its the same phone.

    why would I need a new oculussigfile? I opened command window 'cmd.exe', pasted " adb devices " (no quotes), but get a " Windows Command Line: 'not recognized as an internal or external command, operable program or batch file"

    Also, how do I check android logcat output ? I tried looking on google but nothing

    Edit: I downloaded my oculus signature file by entering my Device ID on OSG generator, but its the exact same file number as before
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Just covering bases.

    First you'll need to make sure that you have either the the path to adb.exe on your search path or you'll need to prepend the full path to adb.exe when you run the commend. From there you can run "<path>/adb logcat" to connect to the logcat service on the device. In another command window try to install your APK using "<path>/adb install -r -f <path to your apk>" and see what, if anything shows up in the logcat output. I would run these command windows side by side as logcat spews a lot of information and I am not sure what all you need to be looking for other then some generic installation error.
     
  5. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    OK, so using <path> and I wrote here won't work. What you need to do is find the path to adb on your hard drive and substitute that path for <path>. For example, if adb.exe existed in C:\Program Files\Android\SDK\bin you would run the command as C:\Program Files\Android\SDK\bin\adb.exe. Same thing goes for the <path to your apk> which I assume you know already since you stated that you are copying the file to your device manually.

    Let say your APK lives in C:\Users\Mumford-and-Dragons\MyNewProject\MyNewProject.apk and adb is located in C:\Program Files\Android\SDK\bin\adb.exe. You would do the following:

    1. Open a new command prompt. Type in "C:\Program Files\Android\SDK\bin\adb.exe logcat -c" to clear logcat data (and save some sanity) then type "C:\Program Files\Android\SDK\bin\adb.exe logcat" to start getting data from logcat.
    2. Open a second command prompt and type in: C:\Program Files\Android\SDK\bin\adb.exe install -r -d C:\Users\Mumford-and-Dragons\MyNewProject\MyNewProject.apk.

    Then watch the first command prompt to see if you get any errors and the second to make sure that you see SUCCESS after running the command. In either case the logcat output should get you something you can use of there is an installation error. Once you installation completes you'll probably want to quit (CTRL-C) the adb logcat process in the first window so that you don't lose the current data set with more data.
     
  6. Mumford-and-Dragons

    Mumford-and-Dragons

    Joined:
    Jan 5, 2016
    Posts:
    129
    So what does entering "cd C:\Users\<insert username here>\AppData\Local\Android\sdk\platform-tools\" in the cmd path actually do? A quick video mentioned something about moving the file or something...I dont feel comfortable tampering with files and moving them etc? What am I trying to do exactly?
     
  7. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    What you are trying to do is to determine if the application you are building is installing correctly (or at all) so we can see if that is the problem or not and if we need to continue on.

    I don't think I provided any instructions to cd to anyplace but regardless, cd means "change directory" and it will put your command prompt into the folder where you are changing to (similar to opening that folder in explorer).
     
  8. Mumford-and-Dragons

    Mumford-and-Dragons

    Joined:
    Jan 5, 2016
    Posts:
    129
    Ok well I shall try it with my teacher tommorow at University if I get the chance, thanks for the help so far. By the way, have you come across my situation before? Is it a one off strange dilema? Why did it do this all of a sudden?
     
  9. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    No, possibly and I have no idea. :-(

    Good Luck
     
    Mumford-and-Dragons likes this.
  10. Mumford-and-Dragons

    Mumford-and-Dragons

    Joined:
    Jan 5, 2016
    Posts:
    129
    Hello, so the problem has been fixed...sort of..?

    So after Unity built the .apk I had to manually drag that file inside the phones folder(when I connected the phone to my PC). This is what I had been doing before I raised the issue here, but for some reason it was not placing it on the phones desktop main page, like it did for the other ones months ago.

    For some strange reason, the .apk files that were being built from Unity were on the phone, however they were being placed inside 'MyFiles>Device Storage' and I had to scroll down to find the .apk file.
    Then I had to click the file, and a message popped up saying 'install blocked'. So I had to click settings, then switch on 'Unknown sources', and install it. Then it was placed on the phones front page.

    I now know why it was being placed in the 'MyFiles' section...because I dragged it there after it was built. However that does not explain why it did not get placed on the front page in the first place, and why I had to go inside 'MyFiles>DeviceStorage' and manually install it like that.

    Do you know why the install was blocked? It never used to do this, I dont want to have to manually do that all the time. I used to build it and it used to replace the .apk on the home screen. Also when it was being built, I didnt even have to pllug my phone in, which is what it used to ask!
     
  11. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Best guess would be the heightened security restrictions in Android N. Many things have been locked down that weren't before.
     
  12. system-idle

    system-idle

    Joined:
    Dec 13, 2013
    Posts:
    26
    I'm having similar problems with Unity 5.5.3f. Have done build for Note 4 running Android 5.1.1, tried on galaxy S6 and S7 with same results. App builds and runs on device, but without split screen/dual camera and doesn't ask to be placed into gear VR device? Not sure what to do/try next.
     
  13. system-idle

    system-idle

    Joined:
    Dec 13, 2013
    Posts:
    26
    Ended up installing Unity 5.6
     
  14. VirtualJosh

    VirtualJosh

    Joined:
    Aug 14, 2017
    Posts:
    1
    @joejo I am currently using Unity 2017.1 and I am having a similar issue regarding the app icon not being displayed after installation. I successfully build the apk file, load it onto my Galaxy S8, open it in MyFiles and install it successfully. Then it gives me two options "Done" or " Open". If I press open, the app will open fine, but if I hit done, the app icon is nowhere to be found... Any ideas what is going on? I do get an error after auto installing to the device when I ctrl+b with my phone connected to the computer which says "No activity in the manifest with action MAIN and category LAUNCHER. Try launching the application manually on the device." Any idea?
     
  15. ccklokwerks

    ccklokwerks

    Joined:
    Oct 21, 2014
    Posts:
    62
    VirtualJosh, does that phone have an "Applications" app separate from the Launcher? It may still be listed there.

    However I am grappling with the very same issue although I have been using 5.5.1p4. OTOH the Unity VR sample app worked for me... once... so you might try that.

    I'm really confused as to what I am doing wrong. (My app works fine in the editor via "split".) I have created an osig file and put it in Plugins/Android/assets. VR support is set with Oculus selected. When my app runs on the phone, even if Gear VR developer is set on, trying to load oculus [even though I thought it should be enabled on start] doesn't succeed.