gpt4 book ai didi

安卓 : Gradle build failed

转载 作者:行者123 更新时间:2023-11-30 00:55:00 26 4
gpt4 key购买 nike

更新 android studio 后,我尝试运行一个项目,但由于某些依赖项错误,它向我显示错误,说存在与依赖项 'com.android.support:support-annotations' 的冲突。

这是我的 build.gradle 文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '24.0.3'
defaultConfig {
applicationId "com.example.abdelnacer.parentooandroid"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}


repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile 'com.parse:parsefacebookutils-v4-android:1.10.4@aar'
compile 'com.parse:parseui-widget-android:0.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
testCompile 'org.mockito:mockito-core:1.+'
testCompile 'org.robolectric:robolectric:3.2-SNAPSHOT'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
androidTestCompile 'com.android.support:support-annotations:24.2.1'
compile 'com.google.guava:guava:19.0'
compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.wefika:flowlayout:0.4.1'
compile 'com.facebook.shimmer:shimmer:0.1.0@aar'
compile 'com.github.armcha:LuseenBottomNavigation:1.8.2'
}

错误

Information:Gradle tasks [:app:generateDebugSources,    :app:generateDebugAndroidTestSources, :app:mockableAndroidJar,  :app:prepareDebugUnitTestDependencies]
Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (25.0.0) and test app (24.2.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'.
> Dependency Error. See console for details.

我真的想不通这是什么问题?

最佳答案

添加:

 androidTestCompile "com.android.support:support-annotations:25.0.0"

关于安卓 : Gradle build failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40330730/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com