2

My project was working fine, but suddenly from this morning it is giving me error like below,

enter image description here

Here in my gradle i have

compile "com.android.support:appcompat-v7:25.1.1"
compile "com.android.support:design:25.1.1"
compile "com.android.support:support-v4:25.1.1"
compile "com.android.support:recyclerview-v7:25.1.1"

still giving me error for 27.0.1. And on click of Install repository and sync it is doing nothing. Not allowing to click that at all. I tried to follow many answers for the gradle build problems but not able to fix this.

Niki
  • 1,566
  • 1
  • 19
  • 36
  • Almost same thing happened to me when my Antivirus blocked the Android Studio from accessing the internet and I was stuck for days with no working solution. Just Check your internet connection first. – Lalit Fauzdar Dec 06 '17 at 08:46
  • My internet connection is working fine. – Niki Dec 06 '17 at 08:51
  • 2
    You have `{libs.supportVersion}` but in your gradle file you have `libraries` , are they same at some other point? – Oguz Ozcan Dec 06 '17 at 08:53
  • yeah i have created const using def libs = rootProject.ext.libraries; for readability. And i tried by writing version itself still no luck . I edited my question for simplicity :) – Niki Dec 06 '17 at 08:55

1 Answers1

0

If any one might get into the similar problem then this is how i was able to fix this,

Well Some of my dependent library wanted the latest build version support(Might be updated or upgraded their code so gradle fetches the lates build if anyone have written version with 2+ or something like that avoid using that if not necessary and give fix library version).

To solve 27.0.1 this question helped me and added

allprojects {
        repositories {
            maven {                                 
                url 'https://maven.google.com/'
                name 'Google'
            }
            jcenter()
        } 
}

Then was getting error for attr keyboardNavigationCluster So I updated my all modules with

buildToolsVersion : "26.0.1"

compileVersion : 26

But after this it was working fine for debug build, but not able to generate signed apk that is bcz my play services need latest version as well to be compatible with 26 so updated it with

playServiceVersion : "11.0.4"

And after which some of my features were broken as some of the methods are deprecated in 26 version, but now it works like charm.

Community
  • 1
  • 1
Niki
  • 1,566
  • 1
  • 19
  • 36