android-productflavors

Dynamically generating productFlavors and sourceSets using a list of names (with properties) in a CSV/TXT file

孤街浪徒 提交于 2019-11-30 17:38:16
问题 This question in continuation of my other question, which i want to improve further. I am being able to group flavors (having common configuration) under sourceSets with the following code : (got it from a genius in the linked question above) import com.android.build.gradle.api.AndroidSourceSet android { sourceSets { [flavor2, flavor4].each { AndroidSourceSet ss -> ss.assets.srcDirs = ['repo-assets/flavor2'] ss.res.srcDirs = ['repo-res/flavor2'] } } } Now, I was wondering if the list [flavor2

Android - How To Get Flavor's ApplicationId

廉价感情. 提交于 2019-11-30 13:50:00
问题 I'm building an app wit different build variant flavors. The flavors are "Free" and "Paid". I want to create some logic on my java classes which should only get triggered if the app is "Paid". Therefore I need a way to get the "applicationId" set during the gradle build process as shown below: gradle.build productFlavors { free { applicationId "com.example.free" resValue "string", "app_name", "Free App" versionName "1.0-free" } paid { applicationId "com.example.paid" resValue "string", "app

Android wear project with 3 flavors, 3 buildTypes and 2 applicationIdSuffixes

微笑、不失礼 提交于 2019-11-30 10:50:15
When I build my project after trying to combine wearApp flavors and buildTypes with applicationIdSuffixes, i get the following error message: Error:Execution failed for task ':app:handleFirstCustomerTestMicroApk'. > The main and the micro apps do not have the same package name. From my app/build.gradle: buildTypes { debug { applicationIdSuffix '.debug' debuggable true embedMicroApp = true } customerTest { applicationIdSuffix '.customertest' debuggable true embedMicroApp = true } release { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' minifyEnabled

Android - How To Get Flavor's ApplicationId

点点圈 提交于 2019-11-30 08:36:43
I'm building an app wit different build variant flavors. The flavors are "Free" and "Paid". I want to create some logic on my java classes which should only get triggered if the app is "Paid". Therefore I need a way to get the "applicationId" set during the gradle build process as shown below: gradle.build productFlavors { free { applicationId "com.example.free" resValue "string", "app_name", "Free App" versionName "1.0-free" } paid { applicationId "com.example.paid" resValue "string", "app_name", "Paid App" versionName "1.0-paid" } Once I have the application ID I could do something like this

Publishing Android Library (aar) to Bintray with chosen flavors

ⅰ亾dé卋堺 提交于 2019-11-30 07:54:44
I've juste added some flavors (or productFlavors if you want) to my project. The fact is that when I publish the library to bintray , all flavors are uploaded (which is great), but I'm unable to use them. The plugin used is the official one here . The uploaded aar: androidsdk-0.0.4-fullRelease.aar androidsdk-0.0.4-fullDebug.aar androidsdk-0.0.4-lightRelease.aar androidsdk-0.0.4-lightDebug.aar As you noted, the fullRelease is named as the classifier , see doc chapter 23.4.1.3 . I am searching for a solution to choose which flavors that I want to upload. I've already looked at bintray examples (

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

筅森魡賤 提交于 2019-11-29 23:37:30
In my app-level build.gradle I have the following flavors: productFlavors { originalFlavour{ } freeFlavour{ } } The thing is building both flavors I get the same App Name. Instead I would like to have different app names for each flavors. Just adding a suffix would be useful. Hope someone could help me. Thanks in advance EDIT : app/src/main/AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="z.fncapps.etsiipod" > <uses-permission android:name="android.permission.CALL_PHONE" android:required="false" /> <uses

Publishing Android Library (aar) to Bintray with chosen flavors

放肆的年华 提交于 2019-11-29 10:41:15
问题 I've juste added some flavors (or productFlavors if you want) to my project. The fact is that when I publish the library to bintray , all flavors are uploaded (which is great), but I'm unable to use them. The plugin used is the official one here. The uploaded aar: androidsdk-0.0.4-fullRelease.aar androidsdk-0.0.4-fullDebug.aar androidsdk-0.0.4-lightRelease.aar androidsdk-0.0.4-lightDebug.aar As you noted, the fullRelease is named as the classifier , see doc chapter 23.4.1.3. I am searching

How to use build types (debug vs release) to set different styles and app names?

混江龙づ霸主 提交于 2019-11-29 09:19:41
Background On Android Studio, you can have different build types, each has its own configuration, similar to product-flavors (as shown here ) The problem I wish that each time I have my app installed somewhere, I would immediatly know which type it was - release or debug, just by looking at it. For this, I think I can use the build.gradle file : buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { debuggable true } } Thing is, I don't know what to put there. I want the app name to be different (and yet have the

Android Gradle product Flavors with Parse Push Notifications

帅比萌擦擦* 提交于 2019-11-29 07:26:48
I am trying to send Push notifications via Parse and integrating product flavors. When I implement product flavors, i am not able to receive Parse Push Notifications. Does anyone have any advise on correcting this issue Gradle app file: apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.project" minSdkVersion 16 targetSdkVersion 21 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } productFlavors{ freeApp{ applicationId "com

Android studio gradle flavor dimensions build varients not working correctly

拥有回忆 提交于 2019-11-29 06:39:36
问题 I have two dimensions of an app, call then green and blue. There will only be these two dimensions but an unlimited number of product flavors. This is the way I'm setting it up in gradle flavorDimensions "green", "blue" productFlavors { one { applicationId "com.app.green.one" versionCode 1 versionName "1.0.0.1"; flavorDimension = "green" } two { applicationId "com.app.blue.two" versionCode 6 versionName "1.0.1"; flavorDimension = "blue" } } But then after i sync gradle, in the build variants