【问题标题】:Failed to resolve: com.afollestad.material-dialogs: core:0.8.5.2无法解决:com.afollestad.material-dialogs: core:0.8.5.2
【发布时间】:2023-03-29 13:15:02
【问题描述】:

我,我使用 Android Studio 2.1.2,在我的项目中,当我将 com.afollestad.material-dialogs 添加到我的 Gradle 时,我遇到了 com.afollestad.material-dialogs:core:0.8.5.2 的问题,显示错误:无法解决:com.afollestad.material-dialogs:core:0.8.5.2,

这是我的 Gradle:

buildscript {
 repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
allprojects {
repositories {
    jcenter()
    mavenLocal()
    mavenCentral()
    maven { url "https://jitpack.io" }
}

这是我的 Gradle:应用程序

apply plugin: 'com.android.application'

android {
 configurations.all {
   resolutionStrategy.force 'com.android.support:support-annotations:25.3.1'
}
compileSdkVersion 25
buildToolsVersion "24.0.2"

defaultConfig {
    applicationId "com.panaceasoft.mokets"
    minSdkVersion 14
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/android-async-http-1.4.4.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.github.rey5137:material:1.2.2'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.stripe:stripe-android:2.0.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.firebase:firebase-crash:9.4.0'
compile 'me.zhanghai.android.materialprogressbar:library:1.1.4'

compile('com.afollestad.material-dialogs:core:0.8.5.2@aar') {
    transitive = true
}
androidTestCompile 'com.android.support:support-annotations:25.1.3'}

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

这是我的 SDK 管理器:

当我删除时

compile('com.afollestad.material-dialogs:core:0.8.5.2@aar') {
    transitive = true
}

一切都很好,gradle 构建完成,没有错误,

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    您应该使用最新版本而不是 aar。

    compile 'com.afollestad.material-dialogs:core:0.9.6.0'
    

    注意

    你应该升级你的版本

    classpath 'com.google.gms:google-services:3.2.0'
    classpath 'com.android.tools.build:gradle:3.1.2'
    

    然后

    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    

    然后

    compile 'com.android.support:appcompat-v7:27.1.1'
    

    终于

    repositories {
            jcenter()
           // google()
            maven {
                url "https://maven.google.com"
            }
        }
    

    【讨论】:

    • 如何升级我的 Gradle?
    • @NaserRajaei classpath 'com.android.tools.build:gradle:2.1.2'
    • 现在我使用的是 gradle:2.1.2,是否升级到 gradle:3.1.2?
    • 我使用 VPN 时出现此错误:Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
    【解决方案2】:

    尝试使用最新版本的库

    compile 'com.afollestad.material-dialogs:core:0.9.6.0'
    

    【讨论】:

    • 当我使用compile 'com.afollestad.material-dialogs:core:0.9.6.0' 时出现此错误:错误:无法解决:com.android.support:appcompat-v7:27.0.1 安装存储库并同步项目在项目结构对话框中打开文件显示
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-15
    • 2021-04-20
    • 2018-11-08
    • 2018-01-23
    • 2016-09-15
    • 2019-03-25
    相关资源
    最近更新 更多