Unresolved dependency :Could not find any version that matches com.android.support:appcompat-v7:29.+

Viewed 7866

There is always this unresolved dependency error showing up when I open a new android project on intelliJ

I have tried:

  1. unchecking the offline box
  2. updating gradle
  3. downloading the latest version from gradel's official website and setting gradle source to the file.
  4. changing from "29.+." to "29.0.0"

Error message:

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+. Show Details Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+. Show Details Affected Modules: app

ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+. Show Details Affected Modules: app

ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+. Show Details Affected Modules: app

ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not find any version that matches com.android.support:appcompat-v7:29.+. Show Details Affected Modules: app

2 Answers

It happens because com.android.support:appcompat-v7:29.x.x doesn't exist.

You can check the revision history and the google maven repo:

27.0.2
27.1.0
27.1.1
28.0.0-alpha1
28.0.0-alpha3
28.0.0-beta01
28.0.0-rc01
28.0.0-rc02
28.0.0

Also check this important note:

Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.

You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

You should use Android Studio. Downloading gradle and linking it to a project yourself is not a good practice. You should let your IDE handle all that work for you whilst you focus on writing good code with your precious time. What you should do do is

  1. Download Android studio from the official site
  2. Create a new project and get a fast stable internet connection
  3. Android studio will download and install gradle at the first build and you are good to go

You may even make a new project with the best (highest) SDK version, and then check back with your own project the differences in the Gradle files. That can really help.

Related