0

I am facing gradle error when I build a project (simple helloworld app) in android studio 2.3.3. I have attached here screen shot that describes error messages I am facing. Please help me how to get rid of it?

NOTE -Please tell me which code files are to be added to get rid of this type of error.

My build.gradle:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'

       }
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Infinite Loops
  • 671
  • 3
  • 11
  • 23

2 Answers2

0

Looking at your question title, Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:25.+

Do not use that kind of version that has + sign as AS will keep on checking any new version of the libraries associated with that kind of declaration. Use it the stable one, as of now 25.4.0 as of June 2017.

And if you're not sure what version is stable or not, head up here, https://developer.android.com/topic/libraries/support-library/revisions.html

Infinite Loops
  • 671
  • 3
  • 11
  • 23
0

Simply go to your project structure, then under Gradle Scripts> build.gradle(Module:app)

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.0.1'
    //not like com.android.support:appcompat-v7:25.+
    testCompile 'junit:junit:4.12'
}

Also newer version of appcompat hint appears under your status bar, use it.

Rohit Singh
  • 411
  • 3
  • 15