I am creating an android application making use of Firebase and OpenTok.
I am using OpenTok to enable video calling in the app. But when I sync my project, gradle always throws an error. The error and app gradle files are mentioned below.
The ERROR:
ERROR: In project 'app' a resolved Google Play services library dependency
depends on another at an exact version (e.g. "[1.9,1
.99999]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.tokbox:opentok-server-sdk:4.3.0 -> commons-codec:commons-codec#[1.9,1.99999], but commons-codec
version was 1.12.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.tokbox:opentok-server-sdk#4.3.0
-- Project 'app' depends onto com.tokbox:opentok-server-sdk#{strictly 4.3.0}
-- Project 'app' depends onto commons-codec:commons-codec#{strictly 1.12}
For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.
The build.gradle (app:module)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.video1"
minSdkVersion 20
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions{
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/io.netty.versions.properties'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.opentok.android:opentok-android-sdk:2.15.3'
implementation 'pub.devrel:easypermissions:2.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.tokbox:opentok-server-sdk:4.3.0'
implementation group: 'com.tokbox', name: 'opentok-server-sdk', version: '4.3.0'
implementation 'com.google.firebase:firebase-firestore:18.0.1'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
The project gradle file:
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
maven { url "https://jitpack.io" }
maven { url 'https://tokbox.bintray.com/maven' }
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please correct like this:
Top level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
maven { url "https://jitpack.io" }
maven { url 'https://tokbox.bintray.com/maven' }
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.video1"
minSdkVersion 20
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions{
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/io.netty.versions.properties'
}
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.opentok.android:opentok-android-sdk:2.15.3'
implementation 'pub.devrel:easypermissions:2.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation group: 'com.tokbox', name: 'opentok-server-sdk', version: '4.3.0'
implementation 'com.google.firebase:firebase-firestore:18.0.1'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Related
I have updated an outdated project and made changes to build gradle, basically upgraded some gradle dependencies and changed gradle version. Project build successfully when I do clean and rebuild. But, when I try to run it on device or emulator it fails to build with transformDexArchiveWithExternalLibsDexMergerForDebug error.
I have tried almost every solution from these two SO threads but still unable to make it work.
Unable to Merge Dex - Android Studio 3.0
Unable to merge dex
Below is my project level gradle.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
dependencies {
}
ext {
libraryVersion = "1.0.8"
}
This is app module gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.dapp.myapp"
minSdkVersion 16
targetSdkVersion 28
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
aaptOptions {
cruncherEnabled = false
useNewCruncher = false
}
lintOptions {
disable 'MissingTranslation'
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':maskedEditText')
implementation project(':aPV')
//implementation files('libs/libGoogleAnalyticsServices.jar')
//compile 'com.android.support:appcompat-v7:19.1.0'
implementation files('libs/simple-xml-2.7.1.jar')
implementation project(':segmentControl')
implementation files('libs/gcm.jar')
implementation project(':UpPlatformSdk')
implementation files('libs/scribe-1.3.7.jar')
implementation files('libs/signpost-commonshttp4-1.2.1.2.jar')
implementation files('libs/signpost-core-1.2.1.2.jar')
// compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
implementation files('libs/joda-time-2.0.jar')
implementation project(':MPChartLib')
implementation files('libs/apache-httpcomponents-httpclient.jar')
implementation files('libs/apache-httpcomponents-httpcore.jar')
/*compile 'com.google.android.gms:play-services:8.4.0'*/
implementation files('libs/libphonenumber-3.8.jar')
implementation files('libs/ebizcharge-sdk.jar')
//compile project(':slicepaymentlibrary')
//compile project(':camerafragment')
implementation project(':camerafragment')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.loopj.android:android-async-http:1.4.5'
implementation 'com.android.support:customtabs:28.0.0'
//implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
}
Build log
Full error stacktrace as pasting here is exceeding character limit
https://pastebin.com/Zukca8FM
Any help appreciated. Thanks.
Update your Google Services dependency:
classpath 'com.google.gms:google-services:3.3.0'
Firebase versioning style has changed, which can cause issues caused by conflicting libraries.
Try this project level gradle, I faced the same issue in my app, but this resolve my issue
buildscript {
repositories {
maven {
url 'http://jcenter.bintray.com'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'de.mobilej.unmock:UnMockPlugin:0.1.0'
classpath 'org.aspectj:aspectjtools:1.8.9'
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:1.0.10'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5"
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1'
classpath "com.archinamon:android-gradle-aspectj:3.2.0"
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
i use firebase and onesignal , but when opening project give me the error ,
i update build-tools , sdk tools and google play services.
Error:Unable to resolve dependency for ':app#debug/compileClasspath': Could not find any version that matches com.google.android.gms:play-services:[15.0.0, 16.0.0).
Open FileShow Details
Error:Unable to resolve dependency for ':app#release/compileClasspath': Could not find any version that matches com.google.android.gms:play-services:[15.0.0, 16.0.0).
Open FileShow Details
build.gradle(project)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url 'https://dl.bintray.com/drummer-aidan/maven'
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
build.gradle(app) :
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "ir.tethys.app"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [
onesignal_app_id : '811bb48c-2350-455d-aa7d-63eea30e226e',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: '845923319180'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
buildToolsVersion '28.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.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:design:27.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.nabinbhandari.android:permissions:3.5'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.afollestad:easyvideoplayer:0.3.0'
implementation 'com.zarinpal:purchase:0.0.3-beta'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
implementation project(':infinitescrollprovider')
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.android.gms:play-services:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
Try adding maven { url "https://maven.google.com" } to your root level build.gradle file like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
You can also do it like this if your version of Gradle plugin supports it:
allprojects {
repositories {
google()
jcenter()
}
}
I am using Android Studio 3.1.3. Gradle build sync failed. I used following method but there is no use of it. If there is any solution please tell me
maven { url "https://maven.google.com" }
Invalidate restart & caches
multiDexEnabled true
Adding mavenLocal() and mavenCentral()
This is module level build.gradle file:
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.developers.a_g.designapp"
minSdkVersion 15
targetSdkVersion 27
buildToolsVersion '27.1.1'
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree( dir: 'libs',include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design-v7:27.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
implementation 'com.github.d-max:spots-dialog:0.7#aar'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.developers.a_g.designapp"
minSdkVersion 15
targetSdkVersion 27
buildToolsVersion '27.1.1'
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree( dir: 'libs',include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design-v7:27.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
implementation 'com.github.d-max:spots-dialog:0.7#aar'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
}
This is project level build.gradle file:
buildscript {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
First make sure that you using:
targetSdkVersion 27
compileSdkVersion 27
buildToolsVersion '27.0.3'
And your gradle be like:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
//..
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
//..
}
}
And also update design implementation like below:
implementation 'com.android.support:design:27.1.1'
You get this error because com.android.support:design-v7 does not exist it exist without -v7, also you can check support libraries in this link any time to make sure you are using the correct library.
You should add google() repository to your dependencies
allprojects {
repositories {
google()
jcenter()
}
}
Don't
implementation 'com.android.support:design-v7:27.1.1'
buildToolsVersion '27.1.1'
Do
implementation 'com.android.support:design:27.1.1'
buildToolsVersion '27.0.3'
Make sure, you added below
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
}
}
Then Clean-Rebuild-Build.
Add the maven URL in all projects section as well and sync the gradle or try removing one by one external libraries and sync the gradle hope it helps
allprojects { repositories { google() jcenter()maven :"http://www.google.com" } }
this is the correct form
implementation 'com.android.support:design:27.1.1'
Upgrade to Android Studio 3.3 destroyed all my projects.
This was one of the problems today I ran into. And after wasting too much time to find a solution, here is the working gradle. By the time I fixed this, I had forgotten what actually I was working on. I really wonder why Google always ship their Android Studio with broken gradle files. Seems like Google engineers even themselves don't know how to write proper gradle, and nobody QAs Android Studio before its final release.
Module level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.journaldev.okhttp"
minSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
}
And the project level gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am trying to build an app on Android 27 and facing issues when I add android com.android.support:support-v4:27.1.0 and com.google.firebase:firebase-messaging:12.0.1 dependencies.
My Project Gradle file looks like this -
buildscript {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My App build.gradle file looks like this -
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.project.webinar"
minSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
//implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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.google.firebase:firebase-messaging:12.0.1'
implementation 'com.google.android.gms:play-services-base:12.0.1'
implementation 'com.android.support:support-v13:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.google.android.gms:play-services-places:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
I am getting the following error while building on Android Studio 3.1.0 -
Can someone please help me how to get support-v4:27.1.0 to work for my app?
it seems your gradle is offline or you have enable proxy
Trying to configure Firebase for my android project. But I get sync error.
build.gradle app directory:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.yunus.relichunter"
minSdkVersion 15
targetSdkVersion 26
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 'com.google.firebase:firebase-core:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-auth:11.8.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'
classpath 'com.google.gms:google-services:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
build.gradle root directory :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You can see the error on the image shown above.
I have tried to install Firebase using its assistance (tools/Firebase) then I tried to do it normally.
As #tyczj says, you can't use classpath 'com.google.gms:google-services:3.0.1' in your module build.gradle (like app module) dependencies block. You only can use it in your project or root build.gradle dependencies block.