我正在尝试导入一些库,比如毕加索等,但Android Studio显示了这条消息。

这是build.gradle(模块:应用程序)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.mypc.urumcafe"
minSdkVersion 17
targetSdkVersion 25
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(include: ['*.jar'], dir: 'libs')
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:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.volley:volley:1.0.0'
compile 'com.amitshekhar.android:android-networking:1.0.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}我只想导入'com.amitshekhar.android:android-networking:1.0.1'but,因为你可以在上传的图像中看到“无法解决”错误。那么我如何修复这个错误?毕加索的库也是如此。谢谢。
发布于 2018-09-09 17:23:23
将您的构建工具版本更新为27.0.3,并将相应的依赖项更新为版本27。
这是更新的build.gradle,它工作得很好。
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.example.mypc.urumcafe"
minSdkVersion 17
targetSdkVersion 27
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(include: ['*.jar'], dir: 'libs')
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:27.1.1'
compile 'com.android.support.constraint:constraint-layout:2.+'
compile 'com.android.volley:volley:1.0.0'
compile 'com.amitshekhar.android:android-networking:1.0.1'
compile 'com.android.support:design:27.1.1'
testCompile 'junit:junit:4.12'
}发布于 2018-09-09 17:24:03
该库的最新版本是1.0.2。使用此命令,然后重试:
com.amitshekhar.android:android-networking:1.0.2发布于 2018-09-09 17:28:51
您可能缺少Maven Central (或用于v1.0.2的jitpack.io )存储库:
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}https://stackoverflow.com/questions/52243040
复制相似问题