compilation variants for firebase in android studio (productFlavors) - android

I am trying to make compilation variants for firebase, where I have two folders one prd and another qas in each folder are the google-services.json. But it shows me the error:
Error:Execution failed for task ':app:processQasDebugManifest'.
Manifest merger failed : Attribute provider#com.google.firebase.provider.FirebaseInitProvider#authorities value=(com.it.mobile.hansa.hbm.firebaseinitprovider) from AndroidManifest.xml:276:13-79
is also present at [com.google.firebase:firebase-common:11.8.0] AndroidManifest.xml:10:13-72 value=(com.it.mobile.hansa.hbm.qas.firebaseinitprovider).
Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:274:9-278:39 to override.
This is my gradle module:
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.it.mobile.hansa.hbm"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "default"
productFlavors {
qas {
applicationId 'com.it.mobile.hansa.hbm.qas'
}
prd {
applicationId 'com.it.mobile.hansa.hbm'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':horizontalcalendar')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.google.android.gms:play-services:11.8.0'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.google.code.gson:gson:2.8.1'
compile 'commons-codec:commons-codec:1.10'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.firebaseui:firebase-ui-database:3.1.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}
apply plugin: 'kotlin-android-extensions'

Related

cannot access zzbck class file for com.google.android.gms.internal.zzbck not found

I have a project which has many libraries included gms:play-services it was working fine but when I add this
compile "com.android.support:support-core-ui:26.4.0" implementation 'com.rahnema.vas3gapi:vas3g-api:2.0.0'
i am getting
Error:(23, 36) error: cannot access zzbck class file for com.google.android.gms.internal.zzbck not found
in my MessageReciverSerivce and here is my app.build.gralde file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.arizeh.arizeh"
minSdkVersion 17
targetSdkVersion 22
multiDexEnabled true
versionCode 31
versionName "3.0.5"
useLibrary 'org.apache.http.legacy'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [manifestApplicationId : "",
onesignal_app_id : "",
onesignal_google_project_number: ""]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.google.android.gms:play-services:11.4.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.android.support:percent:26.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.shawnlin:number-picker:2.4.2'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:support-compat:26.1.0'
compile 'com.daimajia.easing:library:2.0#aar'
compile 'com.daimajia.androidanimations:library:2.2#aar'
compile 'com.zarinpal:purchase:0.0.3-beta'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile "com.android.support:support-core-ui:26.4.0"
implementation 'com.rahnema.vas3gapi:vas3g-api:2.0.0'
}
apply plugin: 'com.google.gms.google-services'

Error:Execution failed for task ':app:transformJackWithJackForRelease'

I am getting the following error while building signed APK
Error:Execution failed for task ':app:transformJackWithJackForRelease'
com.android.build.api.transform.TransformException:
com.android.builder.core.JackToolchain$ToolchainException: Jack configuration exception.
Error while parsing '/Users/omprakash/.android/build-cache/44cf3550bd071d5e2184a0fbb6e8da24ff70e1cb/output/proguard.txt':2
The app is running fine in debug mode.
But when I am building the signed APK I am getting the above error. Tried changing the buildToolVersion but it didn't help. I also have MyApplication class extending MultiDexApplication.
The following is my gradle file:-
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.omagrahari"
manifestPlaceholders = [onesignal_app_id : "9727c212-****-****-**********",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "21051******"]
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
cruncherEnabled = false
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
incremental true
preDexLibraries false
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.zendesk:sdk:1.11.0.1#aar') {
transitive = true;
}
compile('io.fabric.sdk.android:fabric:1.4.1#aar') {
transitive = true;
}
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.d-max:spots-dialog:0.7#aar'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'com.cjj.materialrefeshlayout:library:1.3.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.cocosw:bottomsheet:1.+#aar'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'io.reactivex.rxjava2:rxjava:2.0.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'com.sendbird.sdk:sendbird-android-sdk:3.0.43'
compile 'com.googlecode.libphonenumber:libphonenumber:8.4.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
compile 'com.onesignal:OneSignal:3.+#aar'
}
I don't get how to solve this. Please help.

Multiple dex files define-volley

error when build apk....
[enter image description here][1]
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
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/android/volley/VolleyError;
my gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
The solution is
delete "compile 'com.github.bumptech.glide:volley-integration:1.4.0'
com.android.dex.DexException: Multiple dex files define
Lcom/android/volley/VolleyError;
You should delete
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
Then Clean-Rebuild-Run.
add multiDexEnabled true in gradle file also use same version for compile dependencies check below code
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.morten.gpibwal.desakayuambon"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
compile 'com.github.bumptech.glide:volley-integration:1.4.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.0.0'
testCompile 'junit:junit:4.12'
}
remove unnecessary empty
dexOptions {
}

PolyUtil Android Google Maps

I am using the class PolyUtil from Google Map Utility. But when I am adding dependency in gradle.build it is showing sync error.
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.google.maps.android:android-maps-utils:0.5+'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
What can be the possible reason?
total gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.shaby.supportindia.myapplicationmap"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
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:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.google.maps.android:android-maps-utils:0.5+'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/util/MapCollections$ArrayIterator.class

this is my project build.gradle file .whenever i run the project in android studio i get the duplicate entry: android/support/v4/util/MapCollections$ArrayIterator.class error
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.aitsolution.bizitapp.bizit"
minSdkVersion 16
targetSdkVersion 23
versionCode 14
versionName "1.13"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
dexOptions {
javaMaxHeapSize "3g"
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
// compile fileTree(include: ['*.jar'], dir: 'libs')
// testCompile 'junit:junit:4.12'
compile files('libs/linkedin-j-android.jar')
compile files('libs/MobileOcrEngine.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/twitter4j-core-3.0.5.jar')
compile files('libs/ksoap2_2.6.0.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.0.0'
compile 'com.android.support:cardview-v7:23.3.+'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.edmodo:cropper:1.0.1'
}
I think facebook sdk comes with v4-support library exclude that and try.
compile ('com.facebook.android:facebook-android-sdk:4.6.0') {
exclude module: 'support-v4'
}

Categories

Resources