How to use flavors with different app names in Android studio?

Remove the app_name string from your existing strings.xml file, then you can do this: productFlavors { originalFlavour{ resValue “string”, “app_name”, “Original Flavor Name” } freeFlavour{ resValue “string”, “app_name”, “Free Flavor Name” } } Then the existing reference to @string/app_name in your manifest will refer to a generated string resource, which is based on the flavor … Read more

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 customize the APK file name for product flavors?

Try to put this in your android closure of build.gradle buildTypes { debug { // debug buildType specific stuff } release { // release buildType specific stuff } applicationVariants.all { variant -> if (variant.buildType.name.equals(“release”) && variant.productFlavors[0].name.equals(“green”) && variant.zipAlign) { def apk = variant.outputFile; variant.outputFile = new File(apk.parentFile, “green.apk”); } else if(variant.buildType.name.equals(“release”) && variant.productFlavors[0].name.equals(“blue”) && variant.zipAlign) … Read more

Product Flavor: Duplicate class found

The documentation for variants states (emphasis mine): Note: For a given build variant, Gradle throws a build error if it encounters two or more source set directories that have defined the same Java class. For example, when building a debug APK, you cannot define both src/debug/Utility.java and src/main/Utility.java. This is because Gradle looks at both … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)