상세 컨텐츠

본문 제목

Unity dexarchivemergerexception error while merging dex archives solution

개발생활/Unity Engine

by 한국인맛집 2020. 1. 10. 11:40

본문

반응형

<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 !

 

 

 

 

 

 

반응형

관련글 더보기