Android App Bundle kills Google Play Games integration - Working with plain old APK - How can I fix this?

為{幸葍}努か 提交于 2020-06-17 02:15:08

问题


Here are the facts:

  • My game app is 100% working with debug keystore signed apk using Google Play Games, can sign in, unlock achievements.
  • My game app is 100% working with release keystore signed apk using Google Play Games, can sign in, unlock achievements.
  • Whenever I try to sign in to Google Play Games with my app using app bundle instead of apk, I get SIGN_IN_REQUIRED error, which is stupid on its own, considering I literally want to sign in.

I only found one guy who found the same issue but he is developing his game in Unity, and my app is a native Android app made with Android SDK, so I don't really get his solution.

I won't input screenshots about console settings and SHA1 keys and linked apps and all about those things because as I said, the only difference between the working versions and the not working version is that the not working version has been made to an android app bundle, instead of an apk, so the integrations is correct.

The sad thing is that my apk is more than 100 MB so Google Play doesn't let me upload it anymore, I have to app bundle.

The process of making my app into an app bundle somehow make Google Play Games integration broken.

Any ideas?

E D I T:

As requested, here is the gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4608m

Gradle:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'


android {


    dexOptions {
        javaMaxHeapSize "4g"
    }

    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {


        multiDexEnabled true

        minSdkVersion 17
        targetSdkVersion 28

        applicationId 'hu.mydomain.myappname'
        vectorDrawables.useSupportLibrary = true

    }
    buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    flavorDimensions "game"
    productFlavors {
        flavor_name {

            dimension "game"

            applicationIdSuffix ".suffixflavor"
            versionCode 350
            versionName "2.2.5_getymo"
        }


        other_flavor {

            dimension "game"

            applicationIdSuffix ".othersuffixflavor"
            versionCode 1
            versionName "1.0.0"
        }


    }


    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {


        classpath 'io.fabric.tools:gradle:1.31.1'
    }

}


repositories {
    jcenter()
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://maven.google.com" }
    maven { url "https://jitpack.io" }

    google()


    maven {
        url "https://applovin.bintray.com/Android-Adapter-SDKs"
    }
    maven {
        url 'https://dl.bintray.com/ironsource-mobile/android-sdk'
    }
    maven {
        url "https://chartboostmobile.bintray.com/Chartboost"
    }
    maven {
        url "https://s3.amazonaws.com/smaato-sdk-releases/"
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') {
        transitive = true;
    }

    implementation('com.crashlytics.sdk.android:answers:1.4.6@aar') {
        transitive = true;
    }


    implementation 'com.android.billingclient:billing:1.2'
    implementation 'com.makeramen:roundedimageview:2.2.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.squareup.okio:okio:1.13.0'
    implementation("com.squareup.okhttp3:okhttp:3.14.1")
    implementation 'com.github.javiersantos:PiracyChecker:1.2.3'


    implementation 'androidx.multidex:multidex:2.0.0'


    implementation 'com.google.android.gms:play-services-base:17.2.1'
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
    implementation 'com.google.android.gms:play-services-basement:17.2.1'
    implementation 'com.yodo1:advert-gp:3.7.0'


    implementation 'com.google.android.gms:play-services-auth:18.0.0'
    implementation 'com.google.android.gms:play-services-games:19.0.0'

    implementation 'com.google.firebase:firebase-ads:19.1.0'
    implementation 'com.google.firebase:firebase-core:17.4.0'
}

E D I T 2:

I generated the apk with bundletool from the app bundle and it also works perfectly. That means that Google Play Store do something with my app bundle which kills the Google Play Games integration.

I see that Google Play re-signs the app again with my release key, can this be a problem?


回答1:


What Google is doing is signing the APKs that it generates from the App Bundle.

The release keystore you sign your App Bundle with is effectively only used by Google to authenticate the origin of the artifact. What is served to users are APKs signed with a key called the "app signing key".

If you go to the "App Signing" page in the Play Console, you will be able to find the upload certificate (which corresponds to your release keystore) and the app signing certificate.

Copy the SHA-1 of the app signing certificate.

Then, did you register your game in the Play Console in the "Game services" section? If so, go to "Linked apps", select "Android" and after filling the details of package name etc., you'll be asked to enter the SHA-1 to create the Client ID.

In there, paste the SHA-1 copied previously.

Hope that helps.



来源:https://stackoverflow.com/questions/62148182/android-app-bundle-kills-google-play-games-integration-working-with-plain-old

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!