[solved] Unity / Gradle problems building for Android (Oculus Quest) - Could not resolve audioinaec

Vrroom
Vrroom
edited July 2020 in Photon Voice
Hello.

I've been experiencing some problems building an app for the Oculus Quest using Photon PUN 2 and Photon Voice.

I am using Unity 2019.4.3f1 Personal on Windows 10, and I am building for Android using the Universal Render Pipeline (URP).

Steps to reproduce:
- Start a new project using the wizard, choosing the Universal Render Pipeline.
- Add Photon PUN 2, enter PUN app_id
- Add Photon Voice, add voice app_id to resources.
- Change build target to Android, using the recommended settings from Oculus: https://developer.oculus.com/documentation/unity/unity-conf-settings/
- Choose File -> Build settings...
- Add Scene: Photon/PhotonVoice/Demos/DemoProximityVoiceChat/Scenes/ProximityVoiceChat
- Click 'Build'

Expected outcome:
- an APK is built without any problems

Observed outcome:
- Unity shows a popup, saying "Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'. See the console for details"
- Unity console shows:
CommandInvokationFailure: Gradle build failed. 
C:/Program Files/Unity/Hub/Editor/2019.4.3f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:preReleaseBuild'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
   > Could not resolve :audioinaec.
     Required by:
         project :launcher > project :unityLibrary
      > Could not resolve :audioinaec.
         > invalid start of token at position 55 in pattern /D:/[Projects/urptest/Temp/gradleOut/unityLibrary/libs/[artifact](-[classifier]).[ext]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
]
stdout[

> Configure project :launcher
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-28\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2019.4.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :launcher:prepareLintJar UP-TO-DATE
> Task :unityLibrary:checkReleaseManifest UP-TO-DATE
> Task :unityLibrary:processReleaseManifest
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:generateReleaseResources UP-TO-DATE
> Task :launcher:preReleaseBuild FAILED
> Task :unityLibrary:packageReleaseResources
7 actionable tasks: 3 executed, 4 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <d7067458867d436a825598eb5e44cdf0>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d7067458867d436a825598eb5e44cdf0>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <d7067458867d436a825598eb5e44cdf0>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <bccb16a88ec4456dbf07978c418f407b>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr

Things I've tried:

- Reinstall Unity (+ totally removing unity and unity hub)
- remove .gradle folder from user profile
- Move the audioinaec library around to several folders (armeabi-v7a, x86)
- Use custom gradle build templates
- changing gradle version in manifest

Nothing has worked so far. I really hope someone can help me in the right direction, because our project is stalled right now.

Kind regards,

Symen
VRROOM



Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Vrroom,

    Thank you for choosing Photon!

    What Photon Voice 2 version is this?
    Did you try a different Unity version?
    Did you try changing target & min Android SDK versions?
    Did you try cleaning up Unity's temp/cache folders or even building from a fresh checkout of the repo in a separate new folder?

    At worst case if you do not use Photon microphone type you could remove audioinaec.aar or exclude it from Android build using Import Settings.
  • Turns out I had a crazy idea looking through the logs. When I saw:
          > Could not resolve :audioinaec.
             > invalid start of token at position 55 in pattern /D:/[Projects/urptest/Temp/gradleOut/unityLibrary/libs/[artifact](-[classifier]).[ext]
    

    I realized the decision to include a "[" in the Projects folder name was a very bad decision.
    I removed the "[" from the projects forlder name, and now it builds.

    I am banging my head against the wall right now.