如果我已经添加了 Google Maven 存储库,如何在 Android Studio 中修复此错误?

How do I fix this error in Android Studio if I have already added the Google Maven repository?

我正在使用 Android Studio 2.3.3 版并遇到 Gradle 错误。我在下面添加了 Logcat 错误..

我在 Stack Overflow 上尝试了几个解决方案,其中提到添加 Google Maven 存储库,但错误仍然存​​在。我也在添加以下代码:

Google 已经添加了 Maven 存储库。还是不行。

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/Haris Usmani/AndroidStudioProjects/CabApp/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

我希望 gradle 能够成功构建,但它并没有这样做。相反,它失败了!

这是因为 com.android.support:appcompat-v7:29.x.x 不存在。

您可以检查revision history

Also:

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.