Unity Android build failing

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I am trying to build my unity VR application for Android. However I receive errors every single time, I have changed the gradle version and the source code paths, to no avail. The errors seem to come from a failure to compile a native video player from https://github.com/google/ExoPlayer which I am leveraging in my application, which comes pre-packaged in the Oculus SDK.

CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\>>bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradl>>e-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

stderr[
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\aiden\Documents\GitHub\Lidos\Temp\gradleOut\build.gradle' line: 30

* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> Could not find method implementation() for arguments [{name=audio360-exo28, ext=aar}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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 6s
>>]
>>stdout[
>>NDK is missing a "platforms" directory.
>>If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  >>It is currently set to C:\Users\aiden\AppData\Local\Android\sdk\ndk-bundle.
>>If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or >>local.properties to remove this warning.
>>
>>]

The line where there are build issues comes from this at the first line using implementation

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.exoplayer:exoplayer:2.8.4'
    implementation(name: 'audio360-exo28', ext:'aar')
    implementation
profilepic.png
manpreet 2 years ago
Aiden,

1. Modify your build.gradle dependency as

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.exoplayer:exoplayer:2.8.4'
    //implementation(name: 'audio360-exo28', ext:'aar')
    implementation project(":audio360-exo28")
}

2. Download Audio-360 and add it as new library module.
   https://s3.amazonaws.com/fb360-spatial-workstation/RenderingEngine/1.6.0/Audio360_SDK_1.6.0-3f1ecee14.zip

In your Android Studio project window, go to File  New  New Module..

Select Import .JAR/.AAR Package from the grid of options and select Next

Load the relevant Audio360 ExoPlayer library (audio360-exo28.aar) from Audio360/Android-Java/ into the File na

0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.