我使用的是Android Studio 2.1.2,在我的项目中,我遇到了com.afollestad.material-dialogs:core:0.8.5.2的问题,当我将com.afollestad.material-dialogs添加到我的Gradle时,错误显示:无法解决: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:app
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'
当我删除
compile('com.afollestad.material-dialogs:core:0.8.5.2@aar') {
transitive = true
}
一切都很好,gradle构建完成没有错误,
答案 0 :(得分: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"
}
}
答案 1 :(得分:0)
尝试使用最新版本的库
compile 'com.afollestad.material-dialogs:core:0.9.6.0'