【问题标题】:Failed to resolve: com.android.support:appcompat-v7:28.0.3无法解决:com.android.support:appcompat-v7:28.0.3
【发布时间】:2019-12-10 11:10:27
【问题描述】:

为什么构建失败?

noinspection GradleCompatible

  apply plugin: 'com.android.application'
    android {
     compileSdkVersion 27
     defaultConfig {
      applicationId "com.codingwithmitch.googlemaps2018"
      minSdkVersion 15
      targetSdkVersion 27
      versionCode 1
      versionName "1.0"
      testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      multiDexEnabled true
     }
    buildTypes {
     release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
     }
    }
    buildToolsVersion = '27.0.3'
  }

  dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.3'
    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
    testImplementation 'junit:junit:4.13-beta-3'
    androidTestImplementation 'com.android.support.test:runner:1.1.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    //Android Support Design Library
    implementation 'com.android.support:design:28.0.3'
    //RecyclerView
    implementation 'com.android.support:recyclerview-v7:28.0.3' 
    //Support multidex
    implementation 'com.android.support:multidex:1.0.3'
    //Firebase Core
    implementation 'com.google.firebase:firebase-core:17.0.1'
    //Firebase Authentication
    implementation 'com.google.firebase:firebase-auth:18.1.0'
    // Firestore Firestore
    implementation 'com.google.firebase:firebase-firestore:20.2.0'
    //glide
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
    //Circle ImageView
    implementation 'de.hdodenhof:circleimageview:3.0.0'
  }
  apply plugin: 'com.google.gms.google-services'

【问题讨论】:

    标签: android android-studio build.gradle android-support-library androidx


    【解决方案1】:

    支持库的最新版本是版本28.0.0,没有版本28.0.3。请参阅Recent Support Library Revisions

    您应该考虑为您的项目使用 AndroidX 库,因为您的一些依赖项依赖于它。见AndroidX Overview

    【讨论】:

      【解决方案2】:

      这是因为com.android.support:appcompat-v7:28.0.3不存在

      您可以在官方文档中查看revision history

      你可以:

      • 使用支持库的最新 28.0.0 版本
      • 迁移到androidx

      Also check this note:

      注意:随着 Android 9.0(API 级别 28)的发布,有一个新版本的支持库,称为 AndroidX,它是 Jetpack 的一部分。 AndroidX 库包含现有的支持库,还包含最新的 Jetpack 组件。

      您可以继续使用支持库。历史工件(那些版本为 27 及更早版本,并打包为 android.support.*)仍将在 Google Maven 上可用。但是,所有新库的开发都将在 AndroidX 库中进行。

      我们建议在所有新项目中使用 AndroidX 库。您还应该考虑将现有项目迁移到 AndroidX。

      【讨论】:

        【解决方案3】:

        记录在商店中发布的所有应用程序的迁移将强制停止 2 月。您可以在官方文档中查看修订历史。 - 使用支持库的最新 28.0.0 版本 -迁移到 androidx

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2018-01-03
          • 2017-01-04
          • 2017-01-23
          • 2017-06-13
          • 2020-10-06
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多