Is there a proper way to add external dependencies to an android project using gradle in UE4?

For example, I want to add implementation (‘com.name:name-sdk:1.1’) as an external dependency. In android studio you can do this in the options for the project.

The only way I found to do this in UE4 is to add the dependencies in the source format build.gradle file that is in the engine directory. This would obviously apply to all projects and isn’t really desired.

I couldn’t find anywhere to add these in the configuration but hopefully there is a way? Thanks very much.

The only relevant thing I have seen so far seems to be here:
https://answers.unrealengine.com/que…r-library.html

Chris Babcock says to do this:
<buildGradleAdditions>
<insert>
dependencies {
implementation(‘com.mycompany.myproduct.mylib:mylib-release:1.0’)
}
</insert>
</buildGradleAdditions>

But is that in the xml you are including in the build.cs file? Can you also add repositories for external dependencies. If they are local where do you put them? Can you define a location to add .arr you want to include in an xml of java for use with the JNI?

1 Like