0

I'm not able to login to released apk but debug apk is working fine. google_services.json file is missing to released apk i'm not getting why its happening like this. please some one help me to solve this. Below i listed my app-level dependencies.

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.wrapp.floatlabelededittext:library:0.0.6'
compile 'com.google.code.gson:gson:2.3.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.aakira:expandable-layout:1.4.2@aar'
compile 'de.hdodenhof:circleimageview:2.1.0'

compile 'com.loopj.android:android-async-http:1.4.6'

compile 'com.google.android.gms:play-services:8.1.0'
compile files('libs/opencsv-2.2.jar')
compile files('libs/google-play-services_lib.jar')
}
apply plugin: 'com.google.gms.google-services'

project-level dependencies

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:2.1.0'
}

i'm getting this error E/TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE please anybody help me out.

madhu
  • 35
  • 1
  • 9
  • can you please share log?? – coder Dec 01 '17 at 11:15
  • E/GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. – madhu Dec 01 '17 at 11:19
  • once see this https://stackoverflow.com/questions/37428636/com-android-builder-packaging-duplicatefileexception-duplicate-files-copied-in – coder Dec 01 '17 at 11:24
  • if i add packagingOptions it start giving me wrongings. – madhu Dec 05 '17 at 11:49

1 Answers1

0

You need to update the SHA-1 of release build from the Cloud Console.

  • Open https://console.cloud.google.com/
  • Select your application from the Drop Down at the top
  • APIs and Services -> Credentials
  • Add a key with SHA-1 for the release as well. (You might already having debug key registered)

Update: Add signing config to your app's build.gradle file and run singingReport from the gradle task.

android {
    ...
    signingConfigs {
        release {
            storeFile file("release-key.keystore")
            storePassword 'passwotd'
            keyAlias 'alias'
            keyPassword 'password'
        }
    }

    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }

        debug {
            debuggable true
        }
    }
}
...

Now, click on the "Gradle" button in the Android studio on the right side panel. Click "project name" -> ":app" -> "Tasks" -> "android" -> Double click "signingReport"

After it completes, click on the "Gradle Console" at the bottom right corner. It will show all the SHA-1 for all the keys.

Find the release build key's SHA-1.

Hope it helps

kirtan403
  • 7,293
  • 6
  • 54
  • 97