세상사는 이야기 / 도움이 되었다면 배너 클릭 부탁드려요~ →→→

2019년 5월 28일 화요일

[Android]Unity Android Resolver (1.2.111) mainTemplate.gradle설정

Unity Android 64bit 이슈로 
Android Resolver 버전(1.2.111)이 올라가면서 mainTemplate.gradle 파일의 설정이 변경되어서 정리 해 보았다

Unity 2018.3
Android Resolver(1.2.111)
 - firebase_unity_sdk_6.0.0
 - facebook-unity-sdk-7.15.1
 - GooglePlayGamesPlugin-0.9.64

 - GoogleMobileAds-v3.17.0

mainTemplate.gradle
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
    repositories {
        google()
        jcenter()
    }


    dependencies {
            classpath 'com.android.tools.build:gradle:3.2.0'
**BUILD_SCRIPT_DEPS**}
}


allprojects {
    repositories {
        google()
        jcenter()
        flatDir {
            dirs 'libs'
        }


        maven {
            url 'https://google.bintray.com/exoplayer/'
        }
    }
}


// Android Resolver 자동 생성 (1.2.111)
// Android Resolver Repos Start
allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "file:///C:/WORKSPACE/Assets/Firebase/m2repository" // Assets/Firebase/Editor/AppDependencies.xml:20, Assets/Firebase/Editor/MessagingDependencies.xml:22
        }
        maven {
            url "https://jcenter.bintray.com/" // Assets/GoogleMobileAds/Editor/FacebookMediationDependencies.xml:7, Assets/GoogleMobileAds/Editor/FacebookMediationDependencies.xml:12, Assets/GoogleMobileAds/Editor/UnityMediationDependencies.xml:7, Assets/GoogleMobileAds/Editor/UnityMediationDependencies.xml:12
        }
        maven {
            url "https://maven.google.com/" // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7
        }
        maven {
            url "https://jcenter.bintray.com" // Assets/GoogleMobileAds/Editor/VungleMediationDependencies.xml:7
        }
        maven {
            url "https://jitpack.io" // Assets/GoogleMobileAds/Editor/VungleMediationDependencies.xml:12
        }
        maven {
            url "file:///C:/WORKSPACE/Assets/GooglePlayGames/Editor/m2repository" // Assets/GooglePlayGames/Editor/GooglePlayGamesPluginDependencies.xml:11
        }
        mavenLocal()
        jcenter()
        mavenCentral()
    }
}
// Android Resolver Repos End

apply plugin: 'com.android.application'
**APPLY_PLUGINS**


dependencies {
    compile 'com.android.support:multidex:1.0.2'


    compile fileTree(dir: 'libs', include: ['*.jar'])


// Android Resolver 자동 생성 (1.2.111)
// Android Resolver Dependencies Start
    compile 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    compile 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    compile 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    compile 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    compile 'com.applovin:applovin-sdk:8.1.4' // Assets/GoogleMobileAds/Editor/AppLovinMediationDependencies.xml:6
    compile 'com.facebook.android:audience-network-sdk:5.0.1' // Assets/GoogleMobileAds/Editor/FacebookMediationDependencies.xml:12
    compile 'com.github.vungle:vungle-android-sdk:6.3.24' // Assets/GoogleMobileAds/Editor/VungleMediationDependencies.xml:12
    compile 'com.google.ads.mediation:applovin:8.1.4.0' // Assets/GoogleMobileAds/Editor/AppLovinMediationDependencies.xml:4
    compile 'com.google.ads.mediation:facebook:5.0.1.0' // Assets/GoogleMobileAds/Editor/FacebookMediationDependencies.xml:7
    compile 'com.google.ads.mediation:unity:3.0.0.0' // Assets/GoogleMobileAds/Editor/UnityMediationDependencies.xml:7
    compile 'com.google.ads.mediation:vungle:6.3.24.0' // Assets/GoogleMobileAds/Editor/VungleMediationDependencies.xml:7
    compile 'com.google.android.gms:play-services-ads:17.2.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7
    compile 'com.google.auto.value:auto-value-annotations:1.6.3' // Assets/Firebase/Editor/AppDependencies.xml:22
    compile 'com.google.firebase:firebase-analytics:16.5.0' // Assets/Firebase/Editor/MessagingDependencies.xml:15
    compile 'com.google.firebase:firebase-app-unity:6.0.0' // Assets/Firebase/Editor/AppDependencies.xml:20
    compile 'com.google.firebase:firebase-common:17.0.0' // Assets/Firebase/Editor/AppDependencies.xml:13
    compile 'com.google.firebase:firebase-iid:[18.0.0]' // Assets/Firebase/Editor/MessagingDependencies.xml:13
    compile 'com.google.firebase:firebase-messaging:18.0.0' // Assets/Firebase/Editor/MessagingDependencies.xml:17
    compile 'com.google.firebase:firebase-messaging-unity:6.0.0' // Assets/Firebase/Editor/MessagingDependencies.xml:22
    compile 'com.google.games:gpgs-plugin-support:0.9.64' // Assets/GooglePlayGames/Editor/GooglePlayGamesPluginDependencies.xml:11
    compile 'com.unity3d.ads:unity-ads:3.0.0' // Assets/GoogleMobileAds/Editor/UnityMediationDependencies.xml:12
// Android Resolver Dependencies End

**DEPS**
}


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


    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**'


        multiDexEnabled true
    }


    lintOptions {
        abortOnError false
    }


    dexOptions {
        jumboMode = true
        javaMaxHeapSize "4g"
    }


    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**
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
            jniDebuggable true
        }
        release {
            minifyEnabled **MINIFY_RELEASE**
            useProguard **PROGUARD_RELEASE**
            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**



2019년 5월 17일 금요일

[Unity Android] ClassNotFoundException com.google.games.bridge.TokenFragment

Unity Android 64bit 빌드중 에러가 발생하여서 기존 SDK를 전부 버전업했다.
unity-jar-resolver 1.2.108, 1.2.109 버전이 아래와 같은 토큰 에러가 발생.
아래 설명처럼 1.2.110이상으로 설치하면 된다.

ClassNotFoundException com.google.games.bridge.TokenFragment after updating from version 1.2.104 to 1.2.108


05-06 11:12:23.462 16323-16386/ W/Unity: *** [Play Games Plugin DLL] 05/06/19 11:12:23 +02:00 ERROR: Exception launching token request: java.lang.ClassNotFoundException: com.google.games.bridge.TokenFragment


참고 링크
https://github.com/googlesamples/unity-jar-resolver/issues/208


아래 링크에서 Unity-jar-resolver버전을 안정된 버전으로 유지하도록 하자
https://github.com/googlesamples/unity-jar-resolver/

Error Log