Gradle file for Unity

I saw mentioned in another post that from the newest versions of Unity you can define your own gradle file.
I need this in order to include support libraries and compat libraries.

I created a file called dfwvr.gradle in the Plugins/Android directory but it doesn’t seem to help.
Renaming it to build.gradle made no difference.
I took the basic one from the one supplied.

buildscript {
 repositories {
	jcenter()
 }

 dependencies {
	classpath 'com.android.tools.build:gradle:2.1.0'
 }
}

 allprojects {
 repositories {
    flatDir {
      dirs 'libs'
    }
 }
}

apply plugin: 'com.android.application'

dependencies {
 compile fileTree(dir: 'libs', include: ['*.jar'])
 compile "com.android.support:appcompat-v7:24.2.1"
 compile "com.android.support:support-v4:24.2.1"

**DEPS**}

  android {
   compileSdkVersion **APIVERSION**
   buildToolsVersion '**BUILDTOOLS**'

defaultConfig {
	targetSdkVersion **TARGETSDKVERSION**
}

lintOptions {
	abortOnError false
}
**SIGN**
buildTypes {
	debug {
		jniDebuggable true
	}
	release {
		minifyEnabled false
		proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
		**SIGNCONFIG**
	}
}

 }

I followed what it says here but it doesn’t work: Use Android plugin with android support library dependency with gradle builds in Unity 5.5 - Questions & Answers - Unity Discussions

@liortal

You should name your custom gradle build file Assets/Plugins/Android/mainTemplate.gradle as documented here: Unity - Manual: Gradle for Android

The easiest way to check if your custom Gradle build file is being picked up or not, is by exporting a project (check the “Export Project” checkbox).

After the build completes, you can see if the build.gradle file in the output folder matches the one you used or not.

@theblitz make sure that your custom Gradle is checked in player settings. Check custom Gradle. You should be good to go. If the .Gradle file seems to be reverting after build I am also experiencing the same issue :wink: