How to add google-services.json in Android?

Above asked question has been solved as according to documentation at developer.google.com https://developers.google.com/cloud-messaging/android/client#get-config 2018 Edit : GCM Deprecated, use FCM The file google-services.json should be pasted in the app/ directory. After this is when I sync the project with gradle file the unexpected Top level exception error comes. This is occurring because: Project-Level Gradle File … Read more

Have both GMS and HMS in the project

So, I managed to do it like this: Defined two flavours gms { dimension “services” buildConfigField “String”, “SERVICE_USED”, ‘”g”‘ } hms { dimension “services” buildConfigField “String”, “SERVICE_USED”, ‘”h”‘ } I use the “g” and “h” in the code whenever I need to decide on doing things like: the API requires a deviceType of “android” or … Read more

Initializing Games Client in Android

I had the same problem initially. What I had to do was look at the full, unfiltered LogCat log. There, I saw the message: GamesIntentService(17929): Using Google Play games services requires a metadata tag with the name “com.google.android.gms.games.APP_ID” in the application tag of your manifest So, assuming you created an entry in your strings.xml called … Read more

Error: File path too long on windows, keep below 240 characters

You could also try changing your build directory for your project since that is where most of the path issues will arise. In your root build.gradle file allprojects { buildDir = “C:/tmp/${rootProject.name}/${project.name}” repositories { … } } Android Studio will pick up on the change and still show your new build location in the Project … Read more

How to suppress the “Avoid using bundled version of Google Play services SDK” warning?

In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit. From version 6.5, … Read more