Android Studio 3.2.1: Unfixable Gradle Error












0















I was trying to create a messaging feature for my application. However, I no longer have to create this feature and I don't know what code I need to delete so that these errors will no longer occur:




Gradle sync failed: Cannot resolve external dependency
com.google.gms:google-services:4.2.0 because no repositories are
defined. Required by: project : Consult IDE log for more details (Help
| Show Log) (504 ms)




Here's my gradle file:



apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'



android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.SPELFIT.profile"
minSdkVersion 15
targetSdkVersion 28
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:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'

}

dependencies {
implementation ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar'){
transitive=true
}
}


repositories {
jcenter()
}









share|improve this question




















  • 1





    where is the error? we have to guess the error?

    – Zaid Mirza
    Nov 25 '18 at 5:08











  • @ZaidMirza Gradle sync failed: Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Required by: project : Consult IDE log for more details (Help | Show Log) (504 ms)

    – Cassandra Campbell
    Nov 25 '18 at 6:01


















0















I was trying to create a messaging feature for my application. However, I no longer have to create this feature and I don't know what code I need to delete so that these errors will no longer occur:




Gradle sync failed: Cannot resolve external dependency
com.google.gms:google-services:4.2.0 because no repositories are
defined. Required by: project : Consult IDE log for more details (Help
| Show Log) (504 ms)




Here's my gradle file:



apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'



android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.SPELFIT.profile"
minSdkVersion 15
targetSdkVersion 28
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:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'

}

dependencies {
implementation ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar'){
transitive=true
}
}


repositories {
jcenter()
}









share|improve this question




















  • 1





    where is the error? we have to guess the error?

    – Zaid Mirza
    Nov 25 '18 at 5:08











  • @ZaidMirza Gradle sync failed: Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Required by: project : Consult IDE log for more details (Help | Show Log) (504 ms)

    – Cassandra Campbell
    Nov 25 '18 at 6:01
















0












0








0








I was trying to create a messaging feature for my application. However, I no longer have to create this feature and I don't know what code I need to delete so that these errors will no longer occur:




Gradle sync failed: Cannot resolve external dependency
com.google.gms:google-services:4.2.0 because no repositories are
defined. Required by: project : Consult IDE log for more details (Help
| Show Log) (504 ms)




Here's my gradle file:



apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'



android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.SPELFIT.profile"
minSdkVersion 15
targetSdkVersion 28
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:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'

}

dependencies {
implementation ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar'){
transitive=true
}
}


repositories {
jcenter()
}









share|improve this question
















I was trying to create a messaging feature for my application. However, I no longer have to create this feature and I don't know what code I need to delete so that these errors will no longer occur:




Gradle sync failed: Cannot resolve external dependency
com.google.gms:google-services:4.2.0 because no repositories are
defined. Required by: project : Consult IDE log for more details (Help
| Show Log) (504 ms)




Here's my gradle file:



apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'



android {
compileSdkVersion 28
defaultConfig {
applicationId "com.android.SPELFIT.profile"
minSdkVersion 15
targetSdkVersion 28
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:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'

}

dependencies {
implementation ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar'){
transitive=true
}
}


repositories {
jcenter()
}






android android-studio






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 15:45









LundinCast

2,59341322




2,59341322










asked Nov 25 '18 at 4:40









Cassandra CampbellCassandra Campbell

84




84








  • 1





    where is the error? we have to guess the error?

    – Zaid Mirza
    Nov 25 '18 at 5:08











  • @ZaidMirza Gradle sync failed: Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Required by: project : Consult IDE log for more details (Help | Show Log) (504 ms)

    – Cassandra Campbell
    Nov 25 '18 at 6:01
















  • 1





    where is the error? we have to guess the error?

    – Zaid Mirza
    Nov 25 '18 at 5:08











  • @ZaidMirza Gradle sync failed: Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Required by: project : Consult IDE log for more details (Help | Show Log) (504 ms)

    – Cassandra Campbell
    Nov 25 '18 at 6:01










1




1





where is the error? we have to guess the error?

– Zaid Mirza
Nov 25 '18 at 5:08





where is the error? we have to guess the error?

– Zaid Mirza
Nov 25 '18 at 5:08













@ZaidMirza Gradle sync failed: Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Required by: project : Consult IDE log for more details (Help | Show Log) (504 ms)

– Cassandra Campbell
Nov 25 '18 at 6:01







@ZaidMirza Gradle sync failed: Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Required by: project : Consult IDE log for more details (Help | Show Log) (504 ms)

– Cassandra Campbell
Nov 25 '18 at 6:01














3 Answers
3






active

oldest

votes


















0














add google repo.



repositories {
jcenter()
google()
}





share|improve this answer
























  • I did that. But now in Android studio, it says updating indices and it just keeps buffering.

    – Cassandra Campbell
    Nov 25 '18 at 6:42











  • it will take time... it will download some of them.

    – Zaid Mirza
    Nov 25 '18 at 6:46













  • I am still getting the same error saying that the repositories are not defined.

    – Cassandra Campbell
    Nov 25 '18 at 6:48



















0














Add google() as the first repo for all your



buildscript {
repositories {
google() // must be the first one!!!!
jcenter()
}
}


And



allprojects {
repositories {
google() // must be the first one!!!!
jcenter()
}
}


See here https://stackoverflow.com/a/51151050/8034839






share|improve this answer

































    0















    Cannot resolve external dependency
    com.google.gms:google-services:4.2.0




    Find project root build.gradle file



    buildscript {

    repositories { // add this tag, if you don't have with repo
    google()
    jcenter()
    }

    dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.2.0'
    }
    }


    Hopefully you've proper net connection and make sure you've not checked Offline work in Global Gradle settings.






    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%2f53464699%2fandroid-studio-3-2-1-unfixable-gradle-error%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














      add google repo.



      repositories {
      jcenter()
      google()
      }





      share|improve this answer
























      • I did that. But now in Android studio, it says updating indices and it just keeps buffering.

        – Cassandra Campbell
        Nov 25 '18 at 6:42











      • it will take time... it will download some of them.

        – Zaid Mirza
        Nov 25 '18 at 6:46













      • I am still getting the same error saying that the repositories are not defined.

        – Cassandra Campbell
        Nov 25 '18 at 6:48
















      0














      add google repo.



      repositories {
      jcenter()
      google()
      }





      share|improve this answer
























      • I did that. But now in Android studio, it says updating indices and it just keeps buffering.

        – Cassandra Campbell
        Nov 25 '18 at 6:42











      • it will take time... it will download some of them.

        – Zaid Mirza
        Nov 25 '18 at 6:46













      • I am still getting the same error saying that the repositories are not defined.

        – Cassandra Campbell
        Nov 25 '18 at 6:48














      0












      0








      0







      add google repo.



      repositories {
      jcenter()
      google()
      }





      share|improve this answer













      add google repo.



      repositories {
      jcenter()
      google()
      }






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 25 '18 at 6:30









      Zaid MirzaZaid Mirza

      1,61911123




      1,61911123













      • I did that. But now in Android studio, it says updating indices and it just keeps buffering.

        – Cassandra Campbell
        Nov 25 '18 at 6:42











      • it will take time... it will download some of them.

        – Zaid Mirza
        Nov 25 '18 at 6:46













      • I am still getting the same error saying that the repositories are not defined.

        – Cassandra Campbell
        Nov 25 '18 at 6:48



















      • I did that. But now in Android studio, it says updating indices and it just keeps buffering.

        – Cassandra Campbell
        Nov 25 '18 at 6:42











      • it will take time... it will download some of them.

        – Zaid Mirza
        Nov 25 '18 at 6:46













      • I am still getting the same error saying that the repositories are not defined.

        – Cassandra Campbell
        Nov 25 '18 at 6:48

















      I did that. But now in Android studio, it says updating indices and it just keeps buffering.

      – Cassandra Campbell
      Nov 25 '18 at 6:42





      I did that. But now in Android studio, it says updating indices and it just keeps buffering.

      – Cassandra Campbell
      Nov 25 '18 at 6:42













      it will take time... it will download some of them.

      – Zaid Mirza
      Nov 25 '18 at 6:46







      it will take time... it will download some of them.

      – Zaid Mirza
      Nov 25 '18 at 6:46















      I am still getting the same error saying that the repositories are not defined.

      – Cassandra Campbell
      Nov 25 '18 at 6:48





      I am still getting the same error saying that the repositories are not defined.

      – Cassandra Campbell
      Nov 25 '18 at 6:48













      0














      Add google() as the first repo for all your



      buildscript {
      repositories {
      google() // must be the first one!!!!
      jcenter()
      }
      }


      And



      allprojects {
      repositories {
      google() // must be the first one!!!!
      jcenter()
      }
      }


      See here https://stackoverflow.com/a/51151050/8034839






      share|improve this answer






























        0














        Add google() as the first repo for all your



        buildscript {
        repositories {
        google() // must be the first one!!!!
        jcenter()
        }
        }


        And



        allprojects {
        repositories {
        google() // must be the first one!!!!
        jcenter()
        }
        }


        See here https://stackoverflow.com/a/51151050/8034839






        share|improve this answer




























          0












          0








          0







          Add google() as the first repo for all your



          buildscript {
          repositories {
          google() // must be the first one!!!!
          jcenter()
          }
          }


          And



          allprojects {
          repositories {
          google() // must be the first one!!!!
          jcenter()
          }
          }


          See here https://stackoverflow.com/a/51151050/8034839






          share|improve this answer















          Add google() as the first repo for all your



          buildscript {
          repositories {
          google() // must be the first one!!!!
          jcenter()
          }
          }


          And



          allprojects {
          repositories {
          google() // must be the first one!!!!
          jcenter()
          }
          }


          See here https://stackoverflow.com/a/51151050/8034839







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 '18 at 5:00

























          answered Nov 26 '18 at 4:28









          shizhenshizhen

          3,11541232




          3,11541232























              0















              Cannot resolve external dependency
              com.google.gms:google-services:4.2.0




              Find project root build.gradle file



              buildscript {

              repositories { // add this tag, if you don't have with repo
              google()
              jcenter()
              }

              dependencies {
              classpath 'com.android.tools.build:gradle:3.2.1'
              classpath 'com.google.gms:google-services:4.2.0'
              }
              }


              Hopefully you've proper net connection and make sure you've not checked Offline work in Global Gradle settings.






              share|improve this answer




























                0















                Cannot resolve external dependency
                com.google.gms:google-services:4.2.0




                Find project root build.gradle file



                buildscript {

                repositories { // add this tag, if you don't have with repo
                google()
                jcenter()
                }

                dependencies {
                classpath 'com.android.tools.build:gradle:3.2.1'
                classpath 'com.google.gms:google-services:4.2.0'
                }
                }


                Hopefully you've proper net connection and make sure you've not checked Offline work in Global Gradle settings.






                share|improve this answer


























                  0












                  0








                  0








                  Cannot resolve external dependency
                  com.google.gms:google-services:4.2.0




                  Find project root build.gradle file



                  buildscript {

                  repositories { // add this tag, if you don't have with repo
                  google()
                  jcenter()
                  }

                  dependencies {
                  classpath 'com.android.tools.build:gradle:3.2.1'
                  classpath 'com.google.gms:google-services:4.2.0'
                  }
                  }


                  Hopefully you've proper net connection and make sure you've not checked Offline work in Global Gradle settings.






                  share|improve this answer














                  Cannot resolve external dependency
                  com.google.gms:google-services:4.2.0




                  Find project root build.gradle file



                  buildscript {

                  repositories { // add this tag, if you don't have with repo
                  google()
                  jcenter()
                  }

                  dependencies {
                  classpath 'com.android.tools.build:gradle:3.2.1'
                  classpath 'com.google.gms:google-services:4.2.0'
                  }
                  }


                  Hopefully you've proper net connection and make sure you've not checked Offline work in Global Gradle settings.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 26 '18 at 5:32









                  AryanAryan

                  15.1k73348




                  15.1k73348






























                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53464699%2fandroid-studio-3-2-1-unfixable-gradle-error%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

                      Contact image not getting when fetch all contact list from iPhone by CNContact

                      count number of partitions of a set with n elements into k subsets

                      A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks