2

I updated Android Studio to have 2.2 version. Unfortunately, I got this error (R is in red color) I reinstall Android studio but no change.. R still in red color

I did not even write any code

syn gradle

Error:Failed to resolve: org.hamcrest:hamcrest-core:1.1
<a href="openFile:C:/Users/MainUser/Desktop/LastTry/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>


Error:Failed to resolve: javax.inject:javax.inject:1
<a href="openFile:C:/Users/MainUser/Desktop/LastTry/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

Error:Failed to resolve: com.google.code.findbugs:jsr305:2.0.1
<a href="openFile:C:/Users/MainUser/Desktop/LastTry/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

Error:Failed to resolve: com.squareup:javawriter:2.1.1
<a href="openFile:C:/Users/MainUser/Desktop/LastTry/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

please I need help

1
  • 2
    Clean and Rebuild the Project. Commented Nov 15, 2016 at 15:17

3 Answers 3

1

I had exactly the same problem. Go to File->Project Structure->app->dependencies and remove all the dependencies except these:

com.android.support:appcompat-v7:25.1.0       Compile  
com.android.support:design:25.1.0             Compile  
junit:junit:4.12                              Test compile

This will change the dependencies structure under build.gradle.

Hope this works!!

Sign up to request clarification or add additional context in comments.

Comments

0

This may caused, your build to not compatible with current version.so, Open your root build.gradle file and change Gradle version like this

Old version:

dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
    } 

New version:

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.1'
    }

You can find further details ,For Gradle version compatibility see this.

1 Comment

@MajazenـG are you clean and Rebuild the project Manually ?
0

This is a common error in android studio. I fix it by doing build - clean. That usually works BUT if it doesnt, save and exit AndStudio and then restart

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.