I've been banging my head on this for quite sometime now,i have added Firebase Phone Auth to one of my Android Modules in a Project,and i have made sure that play services and firebase:auth is at 11.0.2 version,but for some reason,it still says that i'm at different versions at 11.0.2 and 10.2.1,any inputs would be helpful
My Error
Error:Execution failed for task ':sample-videochat-webrtc:transformClassesWithDexForDevDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/zzc;
This is my app level gradle which has Firebase Auth
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.20.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.xxx.sample.groupchatwebrtc"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 3
versionName "1.0.2-xxx-xxx"
}
productFlavors {
speedDev {
minSdkVersion 21
}
dev {
minSdkVersion rootProject.minSdkVersion
}
}
buildTypes {
debug {
resValue "string", "versionName", "xxx WebRTC\nBuild version " + defaultConfig.getVersionName()
signingConfig signingConfigs.debug
}
release {
resValue "string", "versionName", "xxx WebRTC\nBuild version " + defaultConfig.getVersionName()
signingConfig signingConfigs.debug
}
}
signingConfigs {
debug {
storeFile file("../cert/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
lintOptions {
abortOnError false
}
buildToolsVersion '26.0.1'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.quickblox:quickblox-android-sdk-videochat-webrtc:$rootProject.qbSdkVersion"
compile(project(":sample-core"))
compile "com.android.support:recyclerview-v7:${rootProject.recyclerviewV7Version}"
compile "com.android.support:support-annotations:${rootProject.supportAnnotationsVersion}"
// compile "com.google.firebase:firebase-auth:${rootProject.firebaseVersion}"
compile "com.navercorp.pulltorefresh:library:${rootProject.pullToRefreshVersion}#aar"
compile("com.crashlytics.sdk.android:crashlytics:${rootProject.crashlyticsVersion}#aar") {
transitive = true;
}
compile "com.android.support:cardview-v7:${rootProject.cardView}"
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.0.2'
}
apply plugin: 'com.google.gms.google-services'
apply from: "../artifacts.gradle"
And this is my project level gradle which has play services version described
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
}
}
ext {
compileSdkVersion = 23
buildToolsVersion = "23.1.1"
minSdkVersion = 19
targetSdkVersion = 26
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
lintAbortOnError = false
// QuickBlox SDK version
qbSdkVersion = '3.3.1'
versionName = '3.3.0'
testRunnerVersion = "0.4.1"
// Dependency versions
playServicesVersion = '11.0.2'
supportV4Version = '23.1.1'
cardView = '23.1.1'
appcompatV7Version = '23.1.1'
recyclerviewV7Version = '23.1.1'
supportAnnotationsVersion = '23.1.1'
designVersion = '23.1.1'
uilVersion = '1.9.0'
glideVersion = '3.6.1'
pullToRefreshVersion = '3.2.3'
stickyListHeaders = '2.7.0'
robotoTextViewVersion = '2.4.3'
stickersVersion = '0.7.3'
crashlyticsVersion = '2.6.8'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.10'
}
def makeJar(variant, project) {
//empty
}
I don't know what else to do in this,please any inputs would be really helpful in this
Related
enter image description hereAfter updating android studion 3.2.1 iam getting this error . Actually StreamLib Module is using for supportive module there is no buildscript, allmodules blocks please check the StreamLib.gridle
Could not find com.android.tools.build:aapt2:3.2.1-4818971.
Searched in the following locations:
file:/Users/user/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom
file:/Users/user/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
file:/Users/user/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom
file:/Users/user/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
file:/Users/user/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom
file:/Users/user/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-osx.jar
Required by:
project :StreamingLib
this is the StreamingLib Gridle file :
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
// android.enableAapt2=false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs 'src/main/libs'
jni.srcDirs = []
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/aapt2-3.2.1-4818971-windows.jar')
}
the above StreamingLib using for supportive library for my app
please help me ?
this is main level graidle file
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
apply plugin: 'com.android.application'
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.google.android.gms:play-services-gcm:10.2.6'
implementation 'org.sufficientlysecure:openpgp-api:10.0'
implementation 'com.soundcloud.android:android-crop:1.0.1#aar'
implementation 'com.android.support:support-v13:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'org.bouncycastle:bcprov-jdk15on:1.52'
implementation 'org.bouncycastle:bcmail-jdk15on:1.52'
implementation 'org.jitsi:org.otr4j:0.22'
implementation 'org.gnu.inet:libidn:1.15'
implementation 'com.google.zxing:core:3.2.1'
implementation 'com.google.zxing:android-integration:3.2.1'
implementation 'de.measite.minidns:minidns-hla:0.2.1'
implementation 'de.timroes.android:EnhancedListView:0.3.4'
implementation 'me.leolin:ShortcutBadger:1.1.12#aar'
implementation 'com.kyleduo.switchbutton:library:1.2.8'
implementation 'org.whispersystems:signal-protocol-java:2.5.3'
implementation 'com.wefika:flowlayout:0.4.1'
implementation 'net.ypresto.androidtranscoder:android-transcoder:0.2.0'
implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:6.2'
implementation project(':StreamingLib')
}
ext {
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
}
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 26
versionCode 3
versionName "2.0"
archivesBaseName += "-$versionName"
applicationId "com.abc"
multiDexEnabled true
//
}
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled && !travisBuild
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
if (project.hasProperty('mStoreFile') &&
project.hasProperty('mStorePassword') &&
project.hasProperty('mKeyAlias') &&
project.hasProperty('mKeyPassword')) {
signingConfigs {
release {
storeFile file(mStoreFile)
storePassword mStorePassword
keyAlias mKeyAlias
keyPassword mKeyPassword
}
}
buildTypes.release.signingConfig = signingConfigs.release
} else {
buildTypes.release.signingConfig = null
}
lintOptions {
disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
}
subprojects {
afterEvaluate {
if (getPlugins().hasPlugin('android') ||
getPlugins().hasPlugin('android-library')) {
configure(android.lintOptions) {
disable 'AndroidGradlePluginVersion', 'MissingTranslation'
}
}
}
}
packagingOptions {
exclude 'META-INF/BCKEY.DSA'
exclude 'META-INF/BCKEY.SF'
}
}
Creating a Firebase Push Notification application in android studio. i did everything and searched everywhere but i could not get any solution. i am getting this same error again and again. Let me post my Gradle files code. please i desperately need help.
Program type already present: com.google.android.gms.common.AccountPicker
and some times
Program type already present: com.google.android.gms.maps.CameraUpdate
here is my app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.Package.Myapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile("com.android.support.test.espresso:espresso-core:$rootProject.ext.espressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintLayoutVersion"
compile "com.google.firebase:firebase-messaging:$rootProject.ext.gmsVersion"
compile "com.google.android.gms:play-services-vision:$rootProject.ext.gmsVersion"
compile "com.google.android.gms:play-services-maps:$rootProject.ext.gmsVersion"
testCompile "junit:junit:$rootProject.ext.junitVersion"
}
apply plugin: 'com.google.gms.google-services'
And here is my project gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext{
// Sdk and tools
minSdkVersion = 15
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = '26.0.2'
// App dependencies
gmsVersion = "11.0.0"
supportLibraryVersion = '27.0.2'
guavaVersion = '18.0'
junitVersion = '4.12'
mockitoVersion = '1.10.19'
powerMockito = '1.6.2'
hamcrestVersion = '1.3'
runnerVersion = '0.5'
rulesVersion = '0.5'
espressoVersion = '2.2.2'
constraintLayoutVersion = "1.0.2"
}
its a simple webview wrapper application. and i am trying to implement Firebase push notification service on it.
On your project gradle file try replace this line
classpath 'com.google.gms:google-services:3.0.0'
with this:
classpath 'com.google.gms:google-services:3.2.0'
Also you may try to update these versions:
buildToolsVersion = '27.0.3'
supportLibraryVersion = '27.1.1'
I use this library and want to increase targetSdkVersion to 24 and want to make this change by adding to top level build.gradle file how can I do this?
I changed build.gradle file to this, but it gives me: cannot find AndroidManifest
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.2'
defaultConfig {
minSdkVersion 9
targetSdkVersion 24
versionCode 1411005
versionName "14.1.1-RC-5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
}
}
allprojects {
repositories {
jcenter()
}
}
Add Top-level build file where you can add configuration options common to all sub-projects/modules.
Add following in build.gradle(project root) file.
ext {
configuration = [
appName : "app_Name",
applicationId : "com.xx.xxx.app",
minSdkVersion : 14,
targetSdkVersion : 24,
compileSdkVersion: 24,
versionCode : 6,
versionName : "1.3.6",
buildToolsVersion: "23.0.3",
]
libraries = [
supportVersion: "24.2.1"
]
}
In modules
def appConfig = rootProject.ext.configuration;
def libs = rootProject.ext.libraries;
dependencies {
compile project(':multiselect')
compile "com.android.support:appcompat-v7:${libs.supportVersion}"
}
For example
Root gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
configuration = [
appName : "app name",
applicationId : "com.xx.xx.app",
minSdkVersion : 14,
targetSdkVersion : 24,
compileSdkVersion: 24,
versionCode : 6,
versionName : "1.3.6",
buildToolsVersion: "23.0.3",
]
libraries = [
supportVersion: "24.2.1"
]
}
buildscript {
repositories {
jcenter() // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
task checkstyle(type: Checkstyle) {
showViolations = true
configFile file("../config/checkstyle/checkstyle.xml")
source 'src/main/java'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
// empty classpath
classpath = files()
}
}
task clean(type: Delete) {
delete(rootProject.buildDir)
}
App Gradle
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
def appConfig = rootProject.ext.configuration;
def libs = rootProject.ext.libraries;
android {
compileSdkVersion appConfig.compileSdkVersion
buildToolsVersion appConfig.buildToolsVersion
defaultConfig {
applicationId appConfig.applicationId
minSdkVersion appConfig.minSdkVersion
targetSdkVersion appConfig.targetSdkVersion
versionCode appConfig.versionCode
versionName appConfig.versionName
signingConfig signingConfigs.config
}
buildTypes {
release {
}
debug {
}
}
productFlavors {
}
}
dependencies {
compile project(':multiselect')
compile "com.android.support:appcompat-v7:${libs.supportVersion}"
compile "com.android.support:cardview-v7:${libs.supportVersion}"
compile "com.android.support:recyclerview-v7:${libs.supportVersion}"
compile "com.android.support:design:${libs.supportVersion}"
}
Module Gradle
apply plugin: 'com.android.library'
def appConfig = rootProject.ext.configuration;
def libs = rootProject.ext.libraries;
android {
compileSdkVersion appConfig.compileSdkVersion
buildToolsVersion appConfig.buildToolsVersion
defaultConfig {
minSdkVersion appConfig.minSdkVersion
targetSdkVersion appConfig.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile "com.android.support:appcompat-v7:${libs.supportVersion}"
compile "com.android.support:design:${libs.supportVersion}"
}
For more about Configure Your Build
You can also try this.
TOP level build gradle
ext {
androidCompileSdkVersion = 25
androidBuildToolsVersion = '25.0.1'
androidMinSdkVersion = 14
androidTargetSdkVersion = 25 }
ext {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
supportLibraryVersion = '25.0.1'
retrofitVersion = '2.3.0'
okhttpVersion = '3.6.0'
parcelerApiVersion = '1.1.9'
daggerVersion = '2.5'
butterknifeVersion = '8.7.0'
dependencies = [
appCompat : "com.android.support:appcompat-v7:$supportLibraryVersion",
recyclerView : "com.android.support:recyclerview-v7:$supportLibraryVersion",
cardView : "com.android.support:cardview-v7:$supportLibraryVersion",
designSupport: "com.android.support:design:$supportLibraryVersion",
support : "com.android.support:support-v4:$supportLibraryVersion",
retrofit :
"com.squareup.retrofit2:retrofit:$retrofitVersion",
retrofitConverterGson: "com.squareup.retrofit2:converter-gson:$retrofitVersion",
retrofitAdapterRxJava: "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion",
retrofitLogging : "com.squareup.okhttp3:logging-interceptor:$okhttpVersion",
rxAndroid : 'io.reactivex.rxjava2:rxandroid:2.0.1',
rxJava : 'io.reactivex.rxjava2:rxjava:2.1.0',
rxBinding : 'com.jakewharton.rxbinding:rxbinding:0.4.0',
butterknife : "com.jakewharton:butterknife:$butterknifeVersion",
butterknifecompiler : "com.jakewharton:butterknife-compiler:$butterknifeVersion",
] }
APP level build gradle
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion
defaultConfig {
applicationId "com.developerandroid"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 1
versionName "1.0"
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
Map<String, String> dependencies = rootProject.ext.dependencies
//support
compile dependencies.appCompat
compile dependencies.recyclerView
compile dependencies.cardView
compile dependencies.designSupport
compile dependencies.support
// retrofit
compile dependencies.retrofit
compile dependencies.retrofitConverterGson
compile dependencies.retrofitLogging
compile dependencies.retrofitAdapterRxJava
// rx
compile dependencies.rxJava
compile dependencies.rxAndroid
compile dependencies.rxBinding
}
I'm debugging stuff on a lib and was trying to integrate crashlytics on it. At first, I've followed this, and after some problems, managed to build the library without errors.
The thing is: when I try to use Fabric.with(this, new Crashlytics(), new CrashlyticsNdk()) in the app which uses that lib, it gives me an "symbol cannot be resolved".
I've tried moving this line into the lib, but all I've got was a NoClassDefFoundError.
Any suggestions?
Below, my lib gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 20
buildToolsVersion '20'
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
versionCode 1
versionName "1.0"
}
buildTypes {
release {
}
}
productFlavors {
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/mylib.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.0#aar') {
transitive = true
}
}
and my app gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 20
buildToolsVersion '20'
defaultConfig {
applicationId 'com.test.app'
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName '1.0'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'LICENSE.txt'
}
sourceSets {
androidTest.setRoot('src/test')
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
}
}
productFlavors {
}
splits {
abi {
enable true
reset()
include 'armeabi'
}
}
}
repositories {
flatDir { dirs 'libs' }
}
dependencies {
compile(name: 'my-framework', ext: 'aar')
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
}
I've regularly used the archivesbasename to rename my output apk's but since using the google-services plugin it is being ignored. Is there anything I can do to get this working again.
Attached my full build.gradle below, be grateful for any pointers.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
project.archivesBaseName = "MyApp";
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.codechimp.myapp"
versionCode 205
versionName "2.4"
minSdkVersion 14
targetSdkVersion 22
}
productFlavors {
prod {
}
dev {
versionName = android.defaultConfig.versionName + " dev"
}
}
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
release }
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.debug
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.google.android.gms:play-services-drive:7.5.0'
compile 'com.google.android.gms:play-services-plus:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.afollestad:material-dialogs:0.6.2.4'
compile 'com.google.code.gson:gson:2.3'
compile 'com.github.andrew-codechimp:androidutils:1.19'
}
def Properties props = new Properties()
props.load(new FileInputStream(file('signing.properties')))
if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
android.buildTypes.release.signingConfig = null
}
Project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.3.0-beta1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
This stopped working for me with android gradle plugin version 1.3.0 using 1.3.1 resolves it.
classpath 'com.android.tools.build:gradle:1.3.1'
Inside your build.gradle for the app you might have this.
android {
//...
defaultConfig {
//...
archivesBaseName = "myprojectname_v${versionName}_${versionCode}"
}
//...
}
If you want to change the APK name based on build type.
android {
//...
buildTypes {
special {
//...
archivesBaseName = "myprojectname_special_v${versionName}_${versionCode}"
}
}
//...
}