Debug间接依赖于Android API级别X,但对于variant';调试';API是否为Y级
我有一个用Android Studio创建的Android项目。我已经向该项目添加了一些第三方依赖项,但是当我尝试在Android Studio中编译时,我遇到了以下错误:Debug间接依赖于Android API级别X,但对于variant';调试';API是否为Y级,android,gradle,android-studio,Android,Gradle,Android Studio,我有一个用Android Studio创建的Android项目。我已经向该项目添加了一些第三方依赖项,但是当我尝试在Android Studio中编译时,我遇到了以下错误: Error:Execution failed for task ':app:prepareDebugDependencies'. > ERROR: Debug has an indirect dependency on Android API level 14, \ but minSdkVersion for va
Error:Execution failed for task ':app:prepareDebugDependencies'.
> ERROR: Debug has an indirect dependency on Android API level 14, \
but minSdkVersion for variant 'debug' is API level 8
使用/gradlew
在命令行上编译工作正常
这个错误意味着什么
我怎么修理它
非常感谢
更新: 我的顶级build.gradle文件:
[snowch@laptop MyApplication]$ cat build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven { url "http://maven.restlet.org" }
}
}
应用程序模块的build.gradle:
[snowch@laptop MyApplication]$ cat app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.snowch.myapplication"
minSdkVersion 8
targetSdkVersion 21
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:21.0.3'
compile 'net.christophersnow:sync-android-p2p:0.0.1-SNAPSHOT'
compile("org.restlet.jse:org.restlet:2.1-M7") {
exclude group: 'org.osgi', module: 'org.osgi.core'
}
compile("org.restlet.jse:org.restlet.ext.simple:2.1-M7")
}
在
app\build.gradle
文件中将minSdkVersion
设置为14
,为我解决了这个问题
感谢您的启发。在您的
manifest.xml
中将最小sdk设置为8,
@MurtazaHussain清单中的此值被gradle覆盖。发布您的gradle文件。我已使用build.gradle文件更新了问题。