Gradle: add dependency for a specific flavour of the library

In your library you need to tell gradle to build every time every variant: android { publishNonDefault true } Then in your application, since recently I guess, you can do this: dependencies { (…) devCompile project(path: ‘:lib’, configuration: ‘devDebug’) // or ‘devRelease’ storeCompile project(path: ‘:lib’, configuration: ‘storeRelease’) // or ‘storeDebug’ } Found in the official … Read more

How to apply plugin to only one flavor in gradle?

Use this code: if (!getGradle().getStartParameter().getTaskRequests() .toString().contains(“Develop”)){ apply plugin: ‘com.google.gms.google-services’ } getGradle().getStartParameter().getTaskRequests().toString() returns something like [DefaultTaskExecutionRequest{args=[:app:generateDevelopDebugSources],projectPath=”null”}] so as stated in the comments Develop must start with an uppercase.

No matching client found for package name (Google Analytics) – multiple productFlavors & buildTypes

Check your package name on your google-services.json it should be same with your local package name of your app Example “client_info”: { “mobilesdk_app_id”: “1:6596814400689:android:65d6f25f5006145”, “android_client_info”: { “package_name”: “com.my.app.package.name” } In this case my local package name is com.my.app.package.name so also i have changed my package name in google-services.json with my local package name