Search Unity

Cant get any of this working , cardboard , android 5.0.1

Discussion in 'Daydream' started by LineKernel, Feb 10, 2017.

  1. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    Hi
    i ve start playing around unity and android on the 8 feb 2017
    this is relevant because it all has been updated on 9th feb

    so far , what i got :
    windows 10 x64 [edit : windows N , the thing without the media stuff blabla]
    galaxys4 android 5.0.1
    adb working
    android sdk installed
    3 unity installed , 5.5.1f1, 5.4.2f2-GVR13 , 5.6.0b7
    my test scene is a cube rotating with a script
    and the camera rotating with the gyro
    camera script gyro started in start and in the update:
    Code (csharp):
    1.  
    2. transform.Rotate(-Input.gyro.rotationRateUnbiased.x,-Input.gyro.rotationRateUnbiased.y,0);
    3.         if (Input.touchCount > 0) {
    4.             transform.rotation = Quaternion.identity;
    5.         }
    6.  
    i can compile apk , run remote 5, gyro(with drift witch is normal) and touchscounts working, changing orientation working,
    (magneto not working because you need to write some plugin but i think it s another topic)
    Nothing to do with VR , all good it seems on Unity5.5.1f1

    same with 5.4.2f2-GVR13 i can remote5 , android build and run , build target the same android 4.4 (lvl 19) , touchcount gyro working , magneto not working , no vr package import nothing

    untill here i m fine
    now i import the GoogleVRForUnity.unitypackage downloaded the same day as the unityGVR install.
    Remote5 is working with gyro and touchcounts the same scene than before

    i havnt changed anything , i just imported , didnt started the packages scenes or anything else from the package and i cant Built and Run anymore and i get this error

    Code (csharp):
    1.  
    2. CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    3. E:\Program Files\Java\jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "E:\Program Files\Unity 5.4.2f2-GVR13\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
    4.  
    5. stderr[
    6.  
    7. ]
    8. stdout[
    9. Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, E:\Docs\Unity Projects\Tuto\UnityGVR Import unityvrgoolepakag\Temp\StagingArea\android-libraries\gvr-permissionsupport-release\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='23'> but library uses targetSdkVersion='24'
    10. ]
    11. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    12. 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)
    13. 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)
    14. UnityEditor.HostView:OnGUI()
    15.  
    so i tried editing the AndroidManifest and the sdk version but i dont really know what i m doing

    ----------------------------------------------------------------------------------------------------------------------------------
    now (10th) i do the same with the new Unity Beta 5.6.0b7 as maybe i ll see some differences
    remote5 is working , gyro and touchcount too.
    build and run not working even before importing the updated version of GoogleVRForUnity.unitypackage
    i get 3 errors

    now i changed in the player setting the Target Api to the exact same than my phone Android 5.0 'Lollipop' (API level 21)
    and it compiled and ran on my phone , witch is great ,

    but then jut import the GoogleVRForUnity.unitypackage (freshly re downloaded today on 10th)
    ask me to update my scripts , so i click go ahead i made a backup
    when done i get this error
    Code (csharp):
    1. Movie importing requires Quicktime to be installed.
    i dont know if this is important or not

    test scene (gyro + touchcount) working in remote ;
    same scene , just package imported , nothing loaded from it =
    build and run: unable to merge the manifest dialog and 3 error

    Code (csharp):
    1.  
    2. CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    3. E:\Program Files\Java\jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "E:\Program Files\Unity 5.6.0b7\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
    4.  
    5. stderr[
    6.  
    7. ]
    8. stdout[
    9. Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, E:\Docs\Unity Projects\Tuto\EmptyWithBeta\Temp\StagingArea\android-libraries\gvr-permissionsupport-release\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='21'> but library uses targetSdkVersion='24'
    10. Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, E:\Docs\Unity Projects\Tuto\EmptyWithBeta\Temp\StagingArea\android-libraries\unitygvr\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='21'> but library uses targetSdkVersion='24'
    11. ]
    12. exit code: 1
    13. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    14. 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)
    15. 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)
    16. UnityEditor.HostView:OnGUI()
    17.  
    18.  
    2nd error -------------------

    Code (csharp):
    1.  
    2. KeyNotFoundException: The given key was not present in the dictionary.
    3. System.Collections.Generic.Dictionary`2[System.String,System.Object].get_Item (System.String key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    4. UnityEditor.Android.PostProcessor.PostProcessorContext.Get[String] (System.String key)
    5. UnityEditor.Android.PostProcessor.Tasks.PublishPackage.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    6. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    7. UnityEditor.Android.PostProcessAndroidPlayer.Launch (BuildTarget target, System.String installPath)
    8. UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (BuildLaunchPlayerArgs args)
    9. UnityEditor.PostprocessBuildPlayer.Launch (BuildTargetGroup targetGroup, BuildTarget target, System.String path, System.String productName, BuildOptions options) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:151)
    10. UnityEditor.HostView:OnGUI()
    11.  
    3rd ---------------------------
    Code (csharp):
    1.  
    2. KeyNotFoundException: The given key was not present in the dictionary.
    3.  


    the reality headset is set to cardboard in case you re wondering , not set to Daydream , and it is the only one that is set

    16-bit depth
    NOT enabled transition
    multipass
    NOT pretected graphics Memory

    i dont know anything about theses settings so i left theses as default


    i m going to tried to edit my xml manifest in the project folder (Assets) to see if i can get things to run
    i changed
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="24" />
    to
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21" />

    didnt work but is now reflected in the 1rst error

    Projects\Tuto\EmptyWithBeta\Temp\StagingArea\android-libraries\gvr-permissionsupport-release\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='21'> but library uses targetSdkVersion='24'
    and
    Projects\Tuto\EmptyWithBeta\Temp\StagingArea\android-libraries\unitygvr\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='21'> but library uses targetSdkVersion='24'

    when in the temp folder and edited the xml manifest indicated in the 1rst error
    so i changed the 24 to 21 again but this chages nothing and is overwriten when i buildandrun

    i then changed both min and target in the player settings to 21
    and then file searched for every xml file in the root of the project folder opened every xml named android manifest or cardboard , and changed all 16 or 19 or 24 to 21

    still nothing and still the same error

    i dont know what i can do more
     
    Last edited: Feb 10, 2017
  2. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    i just found out that i dont have to import anything to get the error
    on a new project
    if i just enable the cardboard headset and buildandrun , i get the 3 errors merging manifest ...

    Code (csharp):
    1.  
    2. CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    3. E:\Program Files\Java\jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "E:\Program Files\Unity 5.6.0b7\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
    4.  
    5. stderr[
    6.  
    7. ]
    8. stdout[
    9. Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, E:\Docs\Unity Projects\Tuto\LastTry with 5.6beta\Temp\StagingArea\android-libraries\unitygvr\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='21'> but library uses targetSdkVersion='24'
    10. ]
    11. exit code: 1
    12. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    13. 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)
    14. 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)
    15. UnityEditor.HostView:OnGUI()
    16.  
    and the other 2 from before
     
  3. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    This a clean Android project using the latest beta and targeting Cardboard? Nothing else installed or changed?
     
  4. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    yes if i stat the latest beta , set up android as default build platform , ask for 21 for min API and 21 target API
    enable virtual reality and put cardboard only in the list and try to build i get theses errors
     
  5. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    ok , so i started android studio , it said that some things were missing , and now it looks like it is re downloading everything
    and also it ofers updates for :
    android support repo , google repo , google apis intelx86 atom system image
    so i m doing them now
     
  6. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    yup still the same , i can compile a test scene with a rotating cube and minimal test intereaction with phone (touchcount and gyro)
    but as soon as i enable VR headset and select cardboard , i get the same errors
     
  7. Freaking-Pingo

    Freaking-Pingo

    Joined:
    Aug 1, 2012
    Posts:
    310
    Could you try replace the manifest values to and see if it works:
    <uses-sdk android:minSdkVersion="22" android:targetSdkVersion="24" />
     
  8. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    i ll try that
    but can you tell me what file(s) i am suppose to edit exactly instead of going though all xml

    meanwhile , i didnt have to interact with manifest (nor the GoogleVRForUnity.unitypackage) since i found out that the bug is when i enable the vr headset
    so i dont think the problem is in the package
    but what i m gona try is to build for 24
     
  9. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    so , i didnt import the package , just tried to compile my pseudo empty scene for API24 both min and target and cardboard enable in vr headsets and i get theses 2 error


    Code (csharp):
    1.  
    2.  
    3. Failed to compile resources with the following parameters:
    4. -bootclasspath "E:/AndroidSDK\platforms\android-24\android.jar" -d "E:\Docs\Unity Projects\Tuto\DAYDREAMSHIT\cardboard update\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\asdasd\cardboardupdate\R.java" "com\google\vr\cardboard\R.java" "com\unity3d\unitygvr\R.java"
    5. warning: E:\AndroidSDK\platforms\android-24\android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler.
    6.   It is recommended that the compiler be upgraded.
    7. warning: E:\AndroidSDK\platforms\android-24\android.jar(java/lang/AutoCloseable.class): major version 52 is newer than 51, the highest major version supported by this compiler.
    8.   It is recommended that the compiler be upgraded.
    9. 2 warnings
    10.  
    11. UnityEditor.HostView:OnGUI()
    12.  
    13.  
    Code (csharp):
    1.  
    2.  
    3. UnityException: Resource compilation failed!
    4. Failed to recompile android resource files. See the Console for details.
    5. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, UnityEditor.Android.CommandInvokationFailure ex)
    6. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuildPointToConsole (System.String title, System.String message)
    7. UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    8. UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    9. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    10. UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
    11. UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
    12. UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
    13. UnityEditor.HostView:OnGUI()
    14.  
    15.  
    so , do this mean i have a problem with my android sdk install ? even if i can compile and run on my phone ?
     
  10. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    If you are using Daydream/Cardboard native integration you will need Android API SDK 24 at least.
     
    Freaking-Pingo likes this.
  11. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    i m not sure what that means?
    nougat sdk (24) is installed in android studio.
    but what ever i do it just doesnt build , what ever my phone s system , i didnt try build and run , i just tried build , even just this is not working .

    in fact i dont really need cardboard , but the thing is i cant access my magneto/compass , and i guess few other things , because some plugin communicating from android/java to unity is needed , i thought it would be easy to just get cardboard up and running but i was wrong

    if i was not a noob i would just grab that from cardboard sdk , and also the shader applied to the camera to compensate the lens diffraction , cause that s basically all anybody would ever need
     
  12. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I think you may also need to update you Android build tools to 24.4.1 as well.
     
  13. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    i ve updated everything in android studio
    and java , and now it builds on 24 but not on 21 still have the manifest merge error
     
  14. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    target sdk has to be 24+. min sdk you can change as needed.
     
  15. LineKernel

    LineKernel

    Joined:
    Dec 11, 2013
    Posts:
    46
    i had not understood that , It s working , i can build , import and run
    i dont know yet how to use this package but i l tinker around

    thank you for this last precision , it helped immensely