Gvr-unity-sdk: Android build error with Unity 2017.2.0b4 and GVR 1.60

Created on 29 Jul 2017  Â·  14Comments  Â·  Source: googlevr/gvr-unity-sdk

I get the following errors if I try to build for Android with Unity 2017.2.0b4 and GVR 1.60.

Error: Duplicate file(s) in apk: 'D:\PROJECT_PATH\Temp\StagingArea\android-libraries\gvr\libs'

UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

CommandInvokationFailure: Failed to build apk.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Guney/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity 2017.2.0b4\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error: Duplicate file(s) in apk: 'D:\PROJECT_PATH\Temp\StagingArea\android-libraries\gvr\libs'
]
stdout[

]
exit code: 255
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)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
bug

Most helpful comment

To temporarily workaround the Error: Duplicate file(s) in apk: '…\Temp\StagingArea\android-libraries\gvr\libs' build error when using GVR SDK with an affected version of Unity (at least 2017.2.0b9 and 2017.2.0b10):

  1. From the Project window select
    _GoogleVR/Plugins/Android/libs/armeabi-v7a/libaudioplugingvrunity_
  2. Uncheck Android in the Inspector window and click Apply
  3. From the Project window select
    _GoogleVR/Plugins/Android/libs/x86/libaudioplugingvrunity_
  4. Uncheck Android in the Inspector window and click Apply
  5. _Don't forget to undo these changes after installing an updated version of Unity, so that the libaudioplugingvrunity library is correctly included in your apk._

All 14 comments

Hi, have you tried deleting the Temp and Library folders and rebuilding the project from scratch?

i get the same error with 2017.2.0b5 and gvr 1.70. Deleting temp and library folders doesnt fix it.

Can you please file a bug with Unity with a small repro project and reply with the case id here?

Solved by modifying x86 plug-in file under libs in inspector. Just changed android Armv7 option to x86 in android setting. Contribution goes to:

https://forum.unity3d.com/threads/cannot-build-for-android-found-plugins-with-same-names-and-architectures-dear-god.431203/

FYI, also hitting this issue on 2017.2.0b9 with GVR 1.70, seems to be related to the libaudiopluginbrunity files in Plugins/Android/libs. I was not able to set the x86 lib to x86 in the platform settings do to the error noted below, and even deleting that file still caused the build failure noted above. I eventually just unchecked all of the libraries included platforms for both files and that fixed the problem.

Failed to parse value ('AnyCPU') for CPU, platform: Android, type: UnityEditor.AndroidPluginImporterExtension+AndroidPluginCPUArchitecture. Default value will be set 'ARMv7'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Dev Specs:
Windows 10
GVR 1.70
Unity 2017.2.b09
Zenphone AR

Looks like Unity 2017.2 beta and GVR SDK are both including the same library.

I believe we ship this library as part of the Unity 2017.2 release. Google should be aware of this and I would hope the SDK would handle checking for this.

  • Micheal who was responsible for getting this into 2017.2 on Unity’s side.

On Sep 4, 2017, at 8:45 AM, Fred Sauer notifications@github.com wrote:

Looks like Unity 2017.2 beta and GVR SDK are both including the same library.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/googlevr/gvr-unity-sdk/issues/669#issuecomment-326991130, or mute the thread https://github.com/notifications/unsubscribe-auth/AWCPOyWviMkGhNmWfoHiS5YPb-10IaFQks5sfBsigaJpZM4OnaRo.

To temporarily workaround the Error: Duplicate file(s) in apk: '…\Temp\StagingArea\android-libraries\gvr\libs' build error when using GVR SDK with an affected version of Unity (at least 2017.2.0b9 and 2017.2.0b10):

  1. From the Project window select
    _GoogleVR/Plugins/Android/libs/armeabi-v7a/libaudioplugingvrunity_
  2. Uncheck Android in the Inspector window and click Apply
  3. From the Project window select
    _GoogleVR/Plugins/Android/libs/x86/libaudioplugingvrunity_
  4. Uncheck Android in the Inspector window and click Apply
  5. _Don't forget to undo these changes after installing an updated version of Unity, so that the libaudioplugingvrunity library is correctly included in your apk._

This saved my ass, after HOURS of pulling my hair out. I can confirm this is still a problem with 2017.2.0f1 and GVR 1.100

This is now fixed in the publicly released 2017.2.0f3.

Still an issue on 2017.3b4, but now further complicated by a new build failure if you simply use the workaround of unchecking the Android platform on both of these libs. The error is that the Gvr Audio Renderer effect is failing to find the native libs it wants (presumably these guys that we've disabled to get around the original error). Trying to workaround this now by also removing the GvrAudioMixer from Resources/ folder of gvr sdk...

Correction: that was on 2017.2.0f2 - will try f3 now. Sorry about that.

I'm unable to reproduce this issue with 2017.3b4. Are you able to reproduce this issue with the GVRDemo in the GoogleVR SDK on 2017.3b4? If so, what is the specific failure mode you're seeing?

I still have this issue using 2017.3.0b1 that is the latest release under linux and GoogleVRForUnity_1.100.1 using the GVRDemo scene
I can build using the workaround described by @fredsa.
What you mean by "specific failure mode" how can I help out?

By failure mode, I mean how do you know it is failing? What message? Can you share all of the details of the error log?

Can you try with the latest 2017.3 beta 7?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vinhui picture vinhui  Â·  6Comments

qiaonifengxue picture qiaonifengxue  Â·  5Comments

SelaO picture SelaO  Â·  4Comments

pandailing picture pandailing  Â·  4Comments

jahKIper picture jahKIper  Â·  3Comments