Android Setup

Setting up gradle

baseProjectTemplate.gradle :

//gradle version 6.1.1
//2021.2.0b4 - 2021.3.36f1
//2022.2.0a1 - 2022.2.0a17
allprojects {
    buildscript {
        ...
        }

        dependencies {            
            classpath 'com.android.tools.build:gradle:4.0.1'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
            **BUILD_SCRIPT_DEPS**
        }
    }
}
//gradle version 6.7.1
//2021.3.37f1 - 2021.3.40f1
allprojects {
    buildscript {
        ...
        }

        dependencies {            
            classpath 'com.android.tools.build:gradle:4.2.2'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
            **BUILD_SCRIPT_DEPS**
        }
    }
}
//gradle version 7.2
//2022.2.0a18 - 2022.3.37f1
plugins {
    id 'com.android.application' version '7.1.2' apply false
    id 'com.android.library' version '7.1.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.3.72' apply false
    **BUILD_SCRIPT_DEPS**
}
//gradle version 7.5.1
//2021.3.41f1+
//2022.3.38f1+
plugins {
    id 'com.android.application' version '7.4.2' apply false
    id 'com.android.library' version '7.4.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.5.20' apply false
    **BUILD_SCRIPT_DEPS**
}

mainTemplate.gradle :

settingsTemplate.gradle :

Resolver usage

For resolver users, please refer to UniversalSDKDependencies.xml

Apply social id to project

Please edit your Assets/Plugins/Android/launcherTemplate.gradle Activate the checkbox to create a file.

check-gradle

Insert the line resValue. If you are not sure, please refer to the Demo.

launcherTemplate.gradle :

AndroidX Use

gradleTemplate.properties :

Proguard settings

  • Obfuscating with Proguard when building

  • Project Settings > Player > Publishing Settings > Minify R8 enabled

If you're using Proguard, add the following to the proguard-user.txt file.

Last updated