1

I know, it looks like a duplicate, but none of the other solutions out there work. I just switched from Android Studio to IntelliJ IDEA (So I don't need 3,000 different IDE's), and after setting it up, I created a new project just to test everything was good. The Gradle build starts off okay but then it throws the error:

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:27.0.3

This is a fresh, stock, not edited build.gradle file.

annoying message

In the messages, it gives me the option to Install Repository and sync project, and thats where my problem begins. No matter what version the AppCompat library is, IntelliJ just keeps slapping this error in my face.

Any tips?

flash76
  • 382
  • 3
  • 23

2 Answers2

4

That's because there is no 27.0.3 for that library. You probably want 27.1.0, or perhaps 27.0.2.

You can see the list of versions for the different artifact groups and artifacts at https://maven.google.com.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • In SDK Manager, `27.1.0` is not shown there, and the same message comes even with `27.0.2`, which I also tried. – flash76 Mar 06 '18 at 22:28
  • @flash76: "In SDK Manager, 27.1.0 is not shown there" -- the SDK Manager does not provide any current Gradle dependencies. The Android Repository in the SDK Manager used to be the source of libraries like `appcompat-v7`, but that changed with Android Studio 3.0. "the same message comes even with 27.0.2, which I also tried" -- then you don't have the `google()` Maven repository set up. See https://stackoverflow.com/a/46024009/115145 – CommonsWare Mar 06 '18 at 23:10
  • Even with the `google()` line in the top level `build.gradle`, IDEA still fails to resolve `appcompat`. – flash76 Mar 06 '18 at 23:54
  • @flash76: Try to figure out where IDEA is looking for it. Usually, as part of the not-found error, Gradle will list a set of repositories where it is searching for the artifact. Make sure the Google Maven repo is listed there. – CommonsWare Mar 07 '18 at 00:01
  • 1
    It turns out it was a problem with the Gradle version. – flash76 Mar 07 '18 at 22:19
  • @flash76 how you come to know and how did you solve that? I am facing same issue – NidhiParekh Apr 26 '18 at 21:00
1

This was the my error when i tried to change my targe SDK version 23 to SDK version 26 Could not resolve all dependencies for configuration ':app:_debugApkCopy'.

Could not find com.android.support:appcompat-v7:27.1.0. Searched in the following locations:

resolved @android/build.gradle :

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url "https://maven.google.com"
        }
    }
}

@app/build.gradle file:

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.1"

    defaultConfig {
        applicationId "WWWWWWWWWW"
        minSdkVersion 16
        targetSdkVersion 27

      ......

  //under dependicies
compile "com.android.support:appcompat-v7:27.1.0"

at least i solved that error that way, yes still another errors i need to solve

greenridinghood
  • 629
  • 5
  • 7