<Solution Refference>
http://today7e.blogspot.com/2018/06/android.html
Developments Environments
Unity : 2019.2.17f
Sdk list
- Admob [Google Mobile Ads] : 4.2
- Firebase Analytics : 6.9
- Firebase message : 6.9
- Google play game service : 10.06
1. File -> Build Settings -> Player Settings ->Build Section -> Check Custom Gradle Template
<multidex version check directory>
// Multidex Directory
C:\Users\admin\AppData\Local\Android\Sdk\extras\android\m2repository\com\android\support\multidex
open the Assets/Plugins/Android/mainTemplate.gradle
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
repositories {**ARTIFACTORYREPOSITORY**
google()
jcenter()
maven { url "https://maven.google.com/"} // *Add*
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
**BUILD_SCRIPT_DEPS**}
}
allprojects {
repositories {**ARTIFACTORYREPOSITORY**
google()
jcenter()
maven { url 'https://maven.google.com'} // * Add *
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.application'
**APPLY_PLUGINS**
dependencies {
compile 'com.android.support:multidex:1.0.1' // * Add *
implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
multiDexEnabled true // * Add *
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
applicationId '**APPLICATIONID**'
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
}
dexOptions { // ** Add
javaMaxHeapSize "4g" // ** Add
} // ** Add
lintOptions {
abortOnError false
}
aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}**SIGN**
buildTypes {
debug {
minifyEnabled **MINIFY_DEBUG**
//useProguard **PROGUARD_DEBUG** // Delete
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
jniDebuggable true
}
release {
minifyEnabled **MINIFY_RELEASE**
//useProguard **PROGUARD_RELEASE** // Delete
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
}
}**PACKAGING_OPTIONS****SPLITS**
**BUILT_APK_LOCATION**
**EXTERNAL_SOURCES**
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}
}**SPLITS_VERSION_CODE****REPOSITORIES****SOURCE_BUILD_SETUP**
Done !
Happy Build Time !
Unity Datetime Basic (0) | 2020.04.14 |
---|---|
java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication (0) | 2020.04.07 |
nullreferenceexception for Preview window UnityEditor.PreviewWindow.OnDisable () (0) | 2020.01.21 |
Firebase 6.6 version Download Link (0) | 2019.12.26 |
[FCM] How to use Unity FCM Notification Diabled Code Block/Xcode 11 - ios (0) | 2019.11.10 |
[xcode 11] cocoapods import Admob & Firebase Analytics (0) | 2019.11.05 |