android - 无法解析 : com. android.support :appcompat-v7:30. 0.0

标签 android android-studio android-support-library android-appcompat androidx

我是初学者,在 Android Studio 中遇到此错误:-

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:30.0.0 Install Repository and sync project
Show in File
Show in Project Structure dialog



这是我的 gradle 代码:-
apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"
    defaultConfig {
        applicationId "com.example.piyushbairagi.demoapp"
        minSdkVersion 15
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:30.0.0'
    testCompile 'junit:junit:4.12'
}

我正在使用 Android Studio 2.2.1 版本进行学习。任何帮助将不胜感激。

最佳答案

这是因为支持库 v.30 不要存在。

使用 安卓x 图书馆:

implementation 'androidx.appcompat:appcompat:1.1.0'

或使用最后一个支持库:
implementation 'com.android.support:appcompat-v7:28.0.0'

关于android - 无法解析 : com. android.support :appcompat-v7:30. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62416064/

相关文章:

android - 使用 edittext 监听器在 android 中进行日期和时间验证

android - Apple/Google 是否提供 iOS 或 Android 中 iCal 现场支持的规范?

java - 屏蔽的 EditText 无法正常工作 android studio

java - 无法在当前主题中找到样式 'coordinateLayoutStyle'

java - 忽略 AndroidX 并希望在 Android Studio 3.2 中单独使用 android 支持库

php - 从 PHP 服务器获取图像到 Android

android - 在 ARM64 上构建 Android 应用程序时出现 AAPT2 错误

android-studio - 如何将 IntelliJ(也是 Android Studio)重做快捷方式配置为 CTRL+Y 而不是 CTRL+SHIFT+Z?

android - 在 android 应用中 Toolbar.setTitle 方法无效 - 应用名称显示为标题

android - 使用 appcompat-v7 在 Android 中视频播放器熄灯模式