0

Android studio gradle build getting error while using Firebase API. I used all parameter from google doc. It's working with sample application. But if I am adding the same library to my application gradle build showing this error.

While building gradle it's getting error like this in Android studio 3.0.1.:

Error:Cause: inconsistent module metadata found. Descriptor: com.google.gms:google-services:3.2.0 Errors: bad group: expected='com.google.gms.' found='com.google.gms'

Here I am adding root gradle file:

buildscript {
 repositories {
 google()
 jcenter()
 }
 dependencies {
 classpath 'com.android.tools.build:gradle:3.0.1'
 classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
 classpath 'com.google.gms.:google-services:3.2.0'
 }
}
allprojects {
 repositories {
 google()
 jcenter()
 mavenCentral()
 maven { url 'https://jitpack.io' }
 maven {
 url 'https://repo.adobe.com/nexus/content/repositories/releases/'
 }
 maven {
 url 'http://maven.localytics.com/public'
 }
 maven { url 'https://maven.google.com' }
 }
}
task clean(type: Delete) {
 delete rootProject.buildDir
}

And also app gradle file:

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
 compileSdkVersion 27
 defaultConfig {
 applicationId "co.hushush.user"
 minSdkVersion 16
 targetSdkVersion 27
 versionCode 5
 versionName "1.4-Beta"
 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 vectorDrawables.useSupportLibrary = true
 multiDexEnabled true
 manifestPlaceholders = [appPackageName: "${applicationId}"]
 }
 buildTypes {
 release {
 minifyEnabled false
 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
 }
 }
 compileOptions {
 sourceCompatibility org.gradle.api.JavaVersion.VERSION_1_8
 targetCompatibility org.gradle.api.JavaVersion.VERSION_1_8
 }
 packagingOptions {
 exclude 'META-INF/LICENSE.txt'
 exclude 'META-INF/LICENSE'
 exclude 'META-INF/NOTICE.txt'
 exclude 'META-INF/NOTICE'
 exclude 'META-INF/DEPENDENCIES'
 exclude 'META-INF/rxjava.properties'
 pickFirst 'AndroidManifest.xml'
 }
 lintOptions {
 checkReleaseBuilds false
 abortOnError false
 }
 dexOptions {
 jumboMode true
 }
 buildToolsVersion '27.0.3'
}
dependencies {
 implementation fileTree(include: ['*.jar'], dir: 'libs')
 implementation 'com.android.support:appcompat-v7:27.1.0'
 implementation 'com.android.support:design:27.1.0'
 implementation 'com.android.support.constraint:constraint-layout:1.0.2'
 implementation 'com.android.support:support-vector-drawable:27.1.0'
 implementation 'com.android.support:support-v4:27.1.0'
 compile 'com.google.firebase:firebase-messaging:11.8.0'
 compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
 compile 'io.reactivex.rxjava2:rxjava:2.1.0'
 compile 'com.squareup.retrofit2:retrofit:2.3.0'
 compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
 compile 'com.google.code.gson:gson:2.7'
 compile 'com.squareup.retrofit2:converter-gson:2.3.0'
 // For easy preference manager
 compile 'com.pixplicity.easyprefs:library:1.9.0'
 testImplementation 'junit:junit:4.12'
 androidTestImplementation 'com.android.support.test:runner:1.0.1'
 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
 implementation 'com.android.support:cardview-v7:27.1.0'
 implementation 'com.android.support:recyclerview-v7:27.1.0'
 implementation 'android.arch.persistence.room:runtime:1.0.0'
 annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
 compile 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
 compile 'com.adobe.creativesdk.foundation:auth:0.9.2006-5'
 compile 'com.adobe.creativesdk:image:4.8.4'
 compile 'com.localytics.android:library:3.8.0'
 compile 'com.android.support:multidex:1.0.1'
 compile 'de.hdodenhof:circleimageview:2.2.0'
 compile 'com.asksira.android:loopingviewpager:1.1.0'
 compile 'com.romandanylyk:pageindicatorview:1.0.0'
 compile 'com.github.bumptech.glide:glide:4.6.1'
 annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
 implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
 compile 'com.paytm.pgsdk:pgsdk:1.0.6'
 compile 'com.squareup.okhttp3:okhttp:3.2.0'
 compile 'com.github.MdFarhanRaja:SearchableSpinner:1.9'
}
apply plugin: 'com.google.gms.google-services'
Doug Stevenson
320k37 gold badges458 silver badges474 bronze badges
asked Mar 6, 2018 at 6:22

1 Answer 1

3

change this:

'com.google.gms.:google-services:3.2.0'

to this:

'com.google.gms:google-services:3.2.0'

there is no point(.) before the :

answered Mar 6, 2018 at 6:25
Sign up to request clarification or add additional context in comments.

3 Comments

Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/internal/zzi; Error:com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/internal/zzi;
check this: stackoverflow.com/questions/34352591/… also clean and rebuild
stackoverflow.com/questions/44455374/… and this stackoverflow.com/questions/46949761/… (there are many links on google about this error)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.