[英]While adding any new dependencies in android build.gradle file. it always show an error
错误:(42,13)无法解决:com.android.volley:volley:1.0.0
在android build.gradle文件中添加任何依赖项时,它始终显示上述错误。 但是,同一项目在另一台计算机上运行时,相同的依赖项可以成功添加。 我为解决此问题进行了大量搜索,但找不到任何解决方案。 请帮助我解决问题,谢谢。
我现在在添加任何依赖项时都遇到相同的错误,但是在我可以在项目上添加任何依赖项之前的几周
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "myappid"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter({url "http://jcenter.bintray.com/"})
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:support-vector-drawable:24.0.0'
// VectorDrawableCompat
compile 'com.android.support:animated-vector-drawable:24.0.0'
compile 'com.android.support:support-annotations:24.0.0'
compile 'com.satsuware.lib:usefulviews:2.3.6'
compile 'com.github.ganfra:material-spinner:1.1.1'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.ramotion.foldingcell:folding-cell:1.0.1'
compile 'com.android.volley:volley:1.0.0'
}
我尝试了多种方法来解决我所遇到的问题,但是没有人可以纠正该问题。 我请求可能经验丰富的开发人员的帮助,他们告诉我他们在那里的生活中从未遇到过这样的问题。 因此,我发现的唯一解决方案是重新安装android studio。 现在,它可以完美运行了。 谢谢您的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.