繁体   English   中英

Flutter Android Studio无法解决:androidx.legacy:legacy-support-v4:27.0.1错误

[英]Flutter Android Studio Failed to resolve: androidx.legacy:legacy-support-v4:27.0.1 error

更新Flutter和一些软件包后,我一直都在

无法解决:androidx.legacy:legacy-support-v4:27.0.1错误

我已将项目迁移到Android X并构建了gradle build 28,但该错误无法清除。 请帮忙。 这是我的app/build.gradle的片段:

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.mycompany"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

    configurations.all {
        resolutionStrategy {
            force 'androidx.media:media:1.0.0'
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-v4:28.0.0'
    api 'androidx.legacy:legacy-support-v4:27.0.1'

}

apply plugin: 'com.google.gms.google-services'

尝试使用以下一个: androidx.legacy:legacy-support-v4:1.0.0

在此处查看更多信息: https : //developer.android.com/jetpack/androidx/migrate

无法解决:androidx.legacy:legacy-support-v4:27.0.1错误

这是因为androidx.legacy:legacy-support-v4:27.0.1不存在。

您可以查看官方文档legacy-support软件包的发行说明。

采用:

api 'androidx.legacy:legacy-support-v4:1.0.0'

您还可以检查google maven仓库 以下是可用版本的列表:

1.0.0-alpha1
1.0.0-alpha3
1.0.0-beta01
1.0.0-rc01
1.0.0-rc02
1.0.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM