AndroidStudio梯度同步:无法解析
我有新的清晰的android应用程序。我想向我的应用程序添加截击,以发出HTTP请求。我正在使用Gradle与Android studio开发应用程序。以下是我的应用程序的屏幕截图: 你看,我要把截取添加到我的应用程序中,把这行代码com.mcxiaoke.截取:library aar:1.0.0添加到build.gradle文件中 我也试着加上改装。但它给出了相同类型的错误:未能解决:bla bla bla 因此,我认为在我的情况下,gradle无法同步com.android以外的任何其他库 我也尝试将这行代码添加到build.gradle中。但一切都没有改变AndroidStudio梯度同步:无法解析,android,android-studio,gradle,android-gradle-plugin,Android,Android Studio,Gradle,Android Gradle Plugin,我有新的清晰的android应用程序。我想向我的应用程序添加截击,以发出HTTP请求。我正在使用Gradle与Android studio开发应用程序。以下是我的应用程序的屏幕截图: 你看,我要把截取添加到我的应用程序中,把这行代码com.mcxiaoke.截取:library aar:1.0.0添加到build.gradle文件中 我也试着加上改装。但它给出了相同类型的错误:未能解决:bla bla bla 因此,我认为在我的情况下,gradle无法同步com.android以外的任何其他库
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
repositories {
mavenCentral()
}
}
请告知
编辑:注释后为项目和模块添加build.gradle文件。
项目:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "domain.testgradle"
minSdkVersion 11
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'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
模块:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "domain.testgradle"
minSdkVersion 11
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'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
你可以用
com.mcxiaoke.volley:library-aar:1.0.1
或其最新版本(非aar)
设定
buildToolsVersion "23.0.1"
和使用
'com.google.code.gson:gson:2.3'
加上这个
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:+'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
Volley现在由jCenter上的Android开源项目发布:
dependencies {
compile 'com.android.volley:volley:1.0.0'
}
尝试像这样添加库
编译'com.mcxiaoke.volley:library:1.0.19'
@atiffarukh,我尝试过,但没有成功。同时我也用这种方法进行了测试:编译'com.mcxiaoke.volley:library:1.0.*',在这里发布build.gradle文件没有成功。@AEMLoviji你能发布build.gradleit吗,但是现在我不能添加这个编译'com.google.code.gson:gson:2.3.1'@AEMLoviji使用'com.google.code.gson:gson:2.3'代替yours@AEMLoviji很高兴听到这个消息。让我告诉大家gsoni已经为这个问题创建了新问题:我添加了这个问题,但同样的错误,未能解决com.android。截取:截取:1.0.0确保您有jcenter()
在您的存储库中