Unity IAP 4.12 bug with Google Play Games plugins and Game Play Services

Hi all,

I’m hoping someone can help me. I’m using Unity 6, with EDM4U 1.283, with Google Play Plugin 10.14.

This issue was nonexistent using Unity IAP 4.11, however, due to needing the 6.0 Android Library, I have no choice but to upgrade.

Here’s what’s happening. Thus far, I was using the plugins that were inside of the Assets/plugins/android folder. I could force resolve and it would build out the individual plugins I needed and using IAP 4.11, I could successfully build out my game with everything working (game play services included).

However, when trying to make a build using unity 6, with IAP 4.12, if I try to make a build using the plugins in the folder, it always fails building because it says there are duplicates (even though there are not, I have checked every folder). If I remove those plugins, I can build successfully, however, then my game play services achievements will no longer function.

Using the custom gradles doesn’t solve the problem either. I can build successfully, and even in the logcat it shows that it is trying to authentic game play services, and it comes back true, and yet, it has not signed in the player nor does the achievement button work as it shows “not implemented.” Again, this is with the Gradle.

So my dilemma is this. In order to adhere to googles 6.0 library, I have to decide between removing my IAP so that I can use the plugins to build out my game with game play services working, or I have to remove game play services so that IAP continue working.

Is there any workarounds anyone knows of? I have tried and looked up everything possible.

Am I missing something in my Gradle? I will post my Gradle below if there is something I am supposed to implement in the decencies that would enable game play services, please let me know:

custom main Gradle:

apply plugin: 'com.android.library'
apply from: '../shared/keepUnitySymbols.gradle'
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
// Android Resolver Dependencies Start
    implementation 'com.google.games:gpgs-plugin-support:0.10.14' // Assets/GooglePlayGames/Editor/GooglePlayGamesPluginDependencies.xml:11
// Android Resolver Dependencies End
**DEPS**}

// Android Resolver Exclusions Start
android {
  packaging {
      exclude ('/lib/armeabi/*' + '*')
      exclude ('/lib/mips/*' + '*')
      exclude ('/lib/mips64/*' + '*')
      exclude ('/lib/x86/*' + '*')
      exclude ('/lib/x86_64/*' + '*')
  }
}
// Android Resolver Exclusions End
android {
    namespace "com.unity3d.player"
    ndkPath "**NDKPATH**"
    ndkVersion "**NDKVERSION**"

    compileSdk **APIVERSION**
    buildToolsVersion = "**BUILDTOOLS**"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    defaultConfig {
        minSdk **MINSDK**
        targetSdk **TARGETSDK**
        ndk {
            abiFilters **ABIFILTERS**
            debugSymbolLevel **DEBUGSYMBOLLEVEL**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
**DEFAULT_CONFIG_SETUP**
    }

    lint {
        abortOnError false
    }

    androidResources {
        noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**PACKAGING**
}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**

build.gradle:

apply plugin: 'com.android.library'
apply from: '../shared/keepUnitySymbols.gradle'


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
// Android Resolver Dependencies Start
    implementation 'com.google.games:gpgs-plugin-support:0.10.14' // Assets/GooglePlayGames/Editor/GooglePlayGamesPluginDependencies.xml:11
// Android Resolver Dependencies End
    implementation(name: 'facebook-android-sdk-4.17.0', ext:'aar')
    implementation(name: 'facebook-android-wrapper-7.9.0', ext:'aar')
    implementation(name: 'appcompat-v7-23.4.0', ext:'aar')
    implementation(name: 'animated-vector-drawable-23.4.0', ext:'aar')
    implementation(name: 'UnityAds', ext:'aar')
    implementation(name: 'common', ext:'aar')
    implementation(name: 'cardview-v7-23.4.0', ext:'aar')
    implementation(name: 'UnityAndroidPermissions', ext:'aar')
    implementation(name: 'customtabs-23.4.0', ext:'aar')
    implementation(name: 'support-vector-drawable-23.4.0', ext:'aar')
    implementation project(':unityLibrary:GooglePlayGamesManifest.androidlib')

}

// Android Resolver Exclusions Start
android {
  packaging {
      exclude ('/lib/armeabi/*' + '*')
      exclude ('/lib/mips/*' + '*')
      exclude ('/lib/mips64/*' + '*')
      exclude ('/lib/x86/*' + '*')
      exclude ('/lib/x86_64/*' + '*')
  }
}
// Android Resolver Exclusions End
android {
    namespace "com.unity3d.player"
    ndkPath "/Applications/Unity/Hub/Editor/6000.0.23f1/PlaybackEngines/AndroidPlayer/NDK"
    ndkVersion "23.1.7779620"

    compileSdk 35
    buildToolsVersion = "34.0.0"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    defaultConfig {
        minSdk 26
        targetSdk 35
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
            debugSymbolLevel 'none'
        }
        versionCode 44
        versionName '1.8.2'
        consumerProguardFiles 'proguard-unity.txt'

    }

    lint {
        abortOnError false
    }

    androidResources {
        noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
    }

    packaging {
        jniLibs {
                useLegacyPackaging true
        }
    }
}




// Dependencies for "com.unity.purchasing". This section is automatically generated.
afterEvaluate {
    dependencies {
        implementation 'com.android.billingclient:billing:6.2.1'
    }
}
// End of dependencies for "com.unity.purchasing".
1 Like