How to reolve error gradle sync failed the library being requested by various other libraries?












0














I wanted to implement firestore in my project but after adding the following line my gradle sync is failing



implementation 'com.google.firebase:firebase-firestore:17.1.2'


and i am getting the error



Gradle sync failed: The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Consult IDE log for more details (Help | Show Log)


what is this error and how to resolve it
also the classpath I am using is



classpath 'com.google.gms:google-services:4.1.0'









share|improve this question
























  • Can I see your dependencies?
    – Hello World
    Nov 23 '18 at 8:37
















0














I wanted to implement firestore in my project but after adding the following line my gradle sync is failing



implementation 'com.google.firebase:firebase-firestore:17.1.2'


and i am getting the error



Gradle sync failed: The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Consult IDE log for more details (Help | Show Log)


what is this error and how to resolve it
also the classpath I am using is



classpath 'com.google.gms:google-services:4.1.0'









share|improve this question
























  • Can I see your dependencies?
    – Hello World
    Nov 23 '18 at 8:37














0












0








0







I wanted to implement firestore in my project but after adding the following line my gradle sync is failing



implementation 'com.google.firebase:firebase-firestore:17.1.2'


and i am getting the error



Gradle sync failed: The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Consult IDE log for more details (Help | Show Log)


what is this error and how to resolve it
also the classpath I am using is



classpath 'com.google.gms:google-services:4.1.0'









share|improve this question















I wanted to implement firestore in my project but after adding the following line my gradle sync is failing



implementation 'com.google.firebase:firebase-firestore:17.1.2'


and i am getting the error



Gradle sync failed: The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Consult IDE log for more details (Help | Show Log)


what is this error and how to resolve it
also the classpath I am using is



classpath 'com.google.gms:google-services:4.1.0'






android firebase android-studio






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 9:40









Aniruddh Parihar

2,15911027




2,15911027










asked Nov 23 '18 at 8:32









Omkar Nadkarni

173




173












  • Can I see your dependencies?
    – Hello World
    Nov 23 '18 at 8:37


















  • Can I see your dependencies?
    – Hello World
    Nov 23 '18 at 8:37
















Can I see your dependencies?
– Hello World
Nov 23 '18 at 8:37




Can I see your dependencies?
– Hello World
Nov 23 '18 at 8:37












3 Answers
3






active

oldest

votes


















0














downgrade the used library to the version shown in console. That is



implementation 'com.google.firebase:firebase-firestore:15.0.1'


This happens due to conflicting versions






share|improve this answer





















  • thanks that worked but if i want to use latest version how do i do that ?
    – Omkar Nadkarni
    Nov 23 '18 at 9:14












  • I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
    – C Forge
    Nov 23 '18 at 10:07



















0














Check this gradle file for project level



// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}





share|improve this answer





























    0














    check this one, I just created for particular issue never tested



     configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    def requested = details.requested
    if (requested.group == 'com.google.firebase') {
    if (!requested.name.startsWith("firebase-firestore")) {
    details.useVersion '17.1.2'
    }
    }

    }
    }


    add this one in defaultConfig tag in app gradle file






    share|improve this answer





















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53443083%2fhow-to-reolve-error-gradle-sync-failed-the-library-being-requested-by-various-ot%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      downgrade the used library to the version shown in console. That is



      implementation 'com.google.firebase:firebase-firestore:15.0.1'


      This happens due to conflicting versions






      share|improve this answer





















      • thanks that worked but if i want to use latest version how do i do that ?
        – Omkar Nadkarni
        Nov 23 '18 at 9:14












      • I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
        – C Forge
        Nov 23 '18 at 10:07
















      0














      downgrade the used library to the version shown in console. That is



      implementation 'com.google.firebase:firebase-firestore:15.0.1'


      This happens due to conflicting versions






      share|improve this answer





















      • thanks that worked but if i want to use latest version how do i do that ?
        – Omkar Nadkarni
        Nov 23 '18 at 9:14












      • I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
        – C Forge
        Nov 23 '18 at 10:07














      0












      0








      0






      downgrade the used library to the version shown in console. That is



      implementation 'com.google.firebase:firebase-firestore:15.0.1'


      This happens due to conflicting versions






      share|improve this answer












      downgrade the used library to the version shown in console. That is



      implementation 'com.google.firebase:firebase-firestore:15.0.1'


      This happens due to conflicting versions







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 23 '18 at 8:57









      C Forge

      1148




      1148












      • thanks that worked but if i want to use latest version how do i do that ?
        – Omkar Nadkarni
        Nov 23 '18 at 9:14












      • I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
        – C Forge
        Nov 23 '18 at 10:07


















      • thanks that worked but if i want to use latest version how do i do that ?
        – Omkar Nadkarni
        Nov 23 '18 at 9:14












      • I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
        – C Forge
        Nov 23 '18 at 10:07
















      thanks that worked but if i want to use latest version how do i do that ?
      – Omkar Nadkarni
      Nov 23 '18 at 9:14






      thanks that worked but if i want to use latest version how do i do that ?
      – Omkar Nadkarni
      Nov 23 '18 at 9:14














      I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
      – C Forge
      Nov 23 '18 at 10:07




      I get this error too, and as of the present this solution works for me. The latest versions currently don't offer any specific new functionalities in my experience. Not all new libraries are released with the latest version simultaneously, and in the in-between transition time, this is how to go by. Although it's a good practice to used the latest versions, that should not be of much concern in the present
      – C Forge
      Nov 23 '18 at 10:07













      0














      Check this gradle file for project level



      // Top-level build file where you can add configuration options common to all sub-projects/modules.

      buildscript {
      ext.kotlin_version = '1.2.30'
      repositories {
      google()
      jcenter()
      }
      dependencies {
      classpath 'com.android.tools.build:gradle:3.1.3'
      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      classpath 'com.google.gms:google-services:4.0.1'
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
      }
      }

      allprojects {
      repositories {
      google()
      jcenter()
      }
      }

      task clean(type: Delete) {
      delete rootProject.buildDir
      }





      share|improve this answer


























        0














        Check this gradle file for project level



        // Top-level build file where you can add configuration options common to all sub-projects/modules.

        buildscript {
        ext.kotlin_version = '1.2.30'
        repositories {
        google()
        jcenter()
        }
        dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        }
        }

        allprojects {
        repositories {
        google()
        jcenter()
        }
        }

        task clean(type: Delete) {
        delete rootProject.buildDir
        }





        share|improve this answer
























          0












          0








          0






          Check this gradle file for project level



          // Top-level build file where you can add configuration options common to all sub-projects/modules.

          buildscript {
          ext.kotlin_version = '1.2.30'
          repositories {
          google()
          jcenter()
          }
          dependencies {
          classpath 'com.android.tools.build:gradle:3.1.3'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath 'com.google.gms:google-services:4.0.1'
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
          }
          }

          allprojects {
          repositories {
          google()
          jcenter()
          }
          }

          task clean(type: Delete) {
          delete rootProject.buildDir
          }





          share|improve this answer












          Check this gradle file for project level



          // Top-level build file where you can add configuration options common to all sub-projects/modules.

          buildscript {
          ext.kotlin_version = '1.2.30'
          repositories {
          google()
          jcenter()
          }
          dependencies {
          classpath 'com.android.tools.build:gradle:3.1.3'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath 'com.google.gms:google-services:4.0.1'
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
          }
          }

          allprojects {
          repositories {
          google()
          jcenter()
          }
          }

          task clean(type: Delete) {
          delete rootProject.buildDir
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 '18 at 8:37









          Android Team

          7,47411033




          7,47411033























              0














              check this one, I just created for particular issue never tested



               configurations.all {
              resolutionStrategy.eachDependency { DependencyResolveDetails details ->
              def requested = details.requested
              if (requested.group == 'com.google.firebase') {
              if (!requested.name.startsWith("firebase-firestore")) {
              details.useVersion '17.1.2'
              }
              }

              }
              }


              add this one in defaultConfig tag in app gradle file






              share|improve this answer


























                0














                check this one, I just created for particular issue never tested



                 configurations.all {
                resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                def requested = details.requested
                if (requested.group == 'com.google.firebase') {
                if (!requested.name.startsWith("firebase-firestore")) {
                details.useVersion '17.1.2'
                }
                }

                }
                }


                add this one in defaultConfig tag in app gradle file






                share|improve this answer
























                  0












                  0








                  0






                  check this one, I just created for particular issue never tested



                   configurations.all {
                  resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                  def requested = details.requested
                  if (requested.group == 'com.google.firebase') {
                  if (!requested.name.startsWith("firebase-firestore")) {
                  details.useVersion '17.1.2'
                  }
                  }

                  }
                  }


                  add this one in defaultConfig tag in app gradle file






                  share|improve this answer












                  check this one, I just created for particular issue never tested



                   configurations.all {
                  resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                  def requested = details.requested
                  if (requested.group == 'com.google.firebase') {
                  if (!requested.name.startsWith("firebase-firestore")) {
                  details.useVersion '17.1.2'
                  }
                  }

                  }
                  }


                  add this one in defaultConfig tag in app gradle file







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 '18 at 10:37









                  Basi

                  443212




                  443212






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53443083%2fhow-to-reolve-error-gradle-sync-failed-the-library-being-requested-by-various-ot%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      What visual should I use to simply compare current year value vs last year in Power BI desktop

                      How to ignore python UserWarning in pytest?

                      Alexandru Averescu