Android的工作室摇篮并不编译指定版本并不、摇篮、工作室、版本

2023-09-06 00:22:17 作者:踩你坟头跳鬼舞i

我一直在开发这个小项目了一些日子,但现在突然如今,Android的工作室开始给我这个错误

 错误:未能执行任务:应用程序:processDebugManifest。
>清单合并失败:用途-SDK:的minSdkVersion 14不能小于14版小宣在库com.android.support:support-v4:21.0.0-rc1
 

我的理解,这是因为它试图编译的Andr​​oid-L库。我想它来编译的版本是旧版本,但它不会。它使我无论进入哪个版本给我上述错误。下面是相关性。

 相关性{
    编译文件树(导演:库,包括:['的* .jar'])
    编译com.android.support:appcompat-v7:20.+
    编译com.android.support:support-v4:20.+
}
 

更新

我刚刚安装的Andr​​oid Studio的Beta版和改变了我的依赖,以一个低于欧根建议。但同步项目中没有给出同样的错误无论哪个版本appcompat的,支持的版本,我指定。它给这个错误每一次我同步

 使用-SDK:的minSdkVersion 14不能比库com.android.support:support-v4:21.0.0-rc1声明版本L时
 
Android studio 3.0.1 文件及类突然变红色 不错错 能编译 怎么回事 看着好别扭

我的更新依赖

 相关性{
    编译文件树(导演:库,包括:['的* .jar'])
    编译com.android.support:appcompat-v7:19.+
    编译com.android.support:support-v4:19.+
}
 

更新2

我不认为我正确理解的Andr​​oid工作室的相关性制度。我只是删除这两个appcompat和支持的依赖性,它仍然给了我同样的错误。我必须从某处删除最初包括库?

build.gradle

*注 - 我加了这两个库又回来了,试过同步,以防万一。但是,没有chenges。

 应用插件:'机器人'

安卓{
    compileSdkVersion 19
    buildToolsVersion19.1.0

    defaultConfig {
        的applicationIDtaz.starz.footynews
        的minSdkVersion 14
        targetSdkVersion 19
        版本code 1
        VERSIONNAME1.0
    }
    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
        }
    }
}

依赖{
    编译文件树(导演:库,包括:['的* .jar'])
    编译com.android.support:appcompat-v7:19.+
    编译com.android.support:support-v4:19.+
    编制项目(:ParallaxScroll)
    编译文件(钢骨混凝土/主/库/ Header2ActionBar-0.2.1.jar)
    编译com.arasthel:gnavdrawer库:+
    编译com.koushikdutta.ion:离子:1.2.4
}
 

顶级build.gradle

  //顶级构建文件,你可以到各子项目/模块添加常用的配置选项。
buildscript {
    库{
        mavenCentral()
    }
    依赖{
        类路径com.android.tools.build:gradle:0.12.+
    }
}

allprojects {
    库{
        mavenCentral()
    }
}
 

解决方案

更新:发现我的情况下,真正的解决。确保不关你的依赖都默默地包括支持-V4 R21在这样做你的 build.gradle

 编译(com.blahblah:胡说:123){
    排除组:com.android.support',模块:支持-V4
}
 

您可以添加排除来所有的图书馆,然后取出一个接一个,直到你找出哪一个是拉动支持-V4 键,让你的错误。而离开排除在那一个。

这里有一个提交新的错误:https://$c$c.google.com/p/android/issues/detail?id=72430

假设你使用的是支持库,解决方法是评论或删除行

 <版> 21.0.0-RC1< /版本>
 

在本地Maven回购上市文件<android-sdk>/extras/android/m2repository/com/android/support-v4/maven-metadata.xml

I've been developing this small project for some days now but suddenly today, Android Studio started to give me this error

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 14 declared in library com.android.support:support-v4:21.0.0-rc1

I understood that it is because it's trying to compile the library of Android-L. The version I want it to compile is the old version but it won't. It keeps giving me the above error no matter which version I enter. Here is the dependencies.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.android.support:support-v4:20.+'
}

UPDATE

I just installed Android Studio Beta and changed my dependencies to the one Eugen suggested below. But syncing the project gives the same error no matter which version of appcompat, support version I specify. It gives this error every single time I sync

uses-sdk:minSdkVersion 14 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1

My updated dependencies

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.android.support:support-v4:19.+'
}

UPDATE 2

I don't think I understand the dependencies system of Android Studio correctly. I just removed both the appcompat and support from the dependencies and it still gives me the same error. Do I have to remove the initially included libraries from somewhere?

build.gradle

*note - I added those two libraries back in again and tried syncing, just in case. But no chenges.

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "taz.starz.footynews"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.android.support:support-v4:19.+'
    compile project(':ParallaxScroll')
    compile files('src/main/libs/Header2ActionBar-0.2.1.jar')
    compile 'com.arasthel:gnavdrawer-library:+'
    compile 'com.koushikdutta.ion:ion:1.2.4'
}

Top level build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

解决方案

UPDATE: Found the real fix for my case. Make sure none of your dependencies are silently including support-v4 r21 by doing this in your build.gradle:

compile("com.blahblah:blah:123") {
    exclude group: 'com.android.support', module:'support-v4'
}

You can add the exclude to all libraries, then remove one-by-one until you figure out which one was pulling in support-v4 and giving you the error. And leave exclude on that one.

There is a new bug filed here: https://code.google.com/p/android/issues/detail?id=72430

Assuming you are using the Support Repository, the workaround is to comment or remove the line

<version>21.0.0-rc1</version>

in the local Maven repo listing file at <android-sdk>/extras/android/m2repository/com/android/support-v4/maven-metadata.xml