我从 git clone 克隆了volleyhttps://android.googlesource.com/platform/frameworks/volley https://android.googlesource.com/platform/frameworks/volley并将其作为新模块导入到 Android Studio 中,但同步时出现以下错误:
无法解析:com.android.volley:volley.1.0.0
我的 build.gradle,在我的应用程序文件夹中:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.cs169_au.volleytest1"
minSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.maps:google-maps-services:0.1.7'
compile 'com.android.volley:volley.1.0.0'
}
repositories {
mavenCentral()
}
Google的官方Volley托管在JCenter中,所以你必须添加jcenter()
to repositories
在项目的构建.gradle:
allprojects {
repositories {
mavenCentral()
jcenter() // Add this line
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)