1
votes

I'm new to Android Studio and it was working just fine and I made few apps and they worked pretty well, and then I downloaded a project from GitHub and tried to import it, the project didn't work but now every time I make new project this error happens:(I can't upload pictures)

Import android.support.v7.app.AppCompatActivity; The 'v7' is colored in red and it says it can't resolve symbol v7

In the messages it giving me this:

Unable to resolve dependency for ':app@debug/compileClasspath': could not resolve com.android.support:appcompat-v7:26.0.0-beta1)

I tried the following:

  1. invalidate caches and restart
  2. compile 'com.android.support:appcompat-v7:26.0.0' in the dependencies in the build.gradle
  3. clean project and sync project with Gradle files

But nothing worked.

I have Android studio 3.0.1
Android emulator 27.1.12
Android SDK platform tools 27.0.1
Android SDK tools 26.1.1

1
If you try with support library version 25, is it working? If not, try removing .gradle in your project. Are you using Android Studio 3.1.1? - ישו אוהב אותך
It didn't work , everything was working just fine but after I imported this project from GitHub this error occurred - Basel Qarabash
No I use version 3.0.1 - Basel Qarabash
Sorry I'm new to android studio , how can I try support library version 25? - Basel Qarabash

1 Answers

2
votes

To use support libraries starting from version 26.0.0 you need to add Google's Maven repository to your project's build.gradle file as described here: https://developer.android.com/topic/libraries/support-library/setup.html

allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }

For Android Studio 3.0.0 and above:

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