UE4.20 AAR imports

Sure, the way I discovered what to do was opening generated project in intermediate by Android Studio, and there were some hints about gradle not syncing. I changed all com.google.android.gms to use the latest version, so my aar.txt import looks something like:

repositories $(ANDROID_HOME)/extras
repositories $(ENGINEDIR)/Source/ThirdParty/Android/extras
com.google.android.gms,play-services-auth,+
com.google.android.gms,play-services-games,+
com.google.android.gms,play-services-nearby,+
com.google.android.gms,play-services-plus,+

I think it could cause issues if you have a specific API level in mind, in that case, you just need to be sure they all are using the same version.

I have used com.android.support:appcompat for creating a custom activity. You also need to make sure all your com.android.support includes are using the same version(I used 24.2.1 version, so the full include was compile(‘com.android.support:appcompat-v7:24.2.1’)).

In ue4.20 there missing some includes in build.gradle, so I added them too:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
		classpath 'com.google.gms:google-services:4.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    apply from: 'buildscriptAdditions.gradle', to: buildscript
}

apply from: 'baseBuildAdditions.gradle'

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
1 Like