导入应用程序兼容性-V7 Android Studio中 [英] Import appcompat-v7 in Android Studio

查看:210
本文介绍了导入应用程序兼容性-V7 Android Studio中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图添加应用程序兼容性-V7库chaning搜索栏的暗示色彩。但是我不能使它工作。任何想法?这是我的文件的gradle:

  buildscript {
    库{
        mavenCentral()
    }
    依赖{
        类路径'com.android.tools.build:gradle:0.7.+
    }
}allprojects {
    库{
        mavenCentral()
    }
}应用插件:'机器人'安卓{
    compileSdkVersion 19
    buildToolsVersion '19 .0.1    defaultConfig {
        14的minSdkVersion
        targetSdkVersion 19
        版本code 1
        的versionName1.0
    }
    buildTypes {
        发布 {
            runProguard假
            proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard的-rules.txt
        }
    }
}应用插件:'机器人'库{
    mavenCentral()
}依赖{
    编译com.fasterxml.jackson.core:杰克逊 - 数据绑定:2.2 +。
    编译com.fasterxml.jackson.core:杰克逊核心:2.2 +。
    编译com.fasterxml.jackson.core:杰克逊的注解:2.2 +。
    编译公地郎咸平:公地郎咸平:2.6
    编译com.nhaarman.listviewanimations:库:2.5.2
    编译文件(库/ TestFlightLib.jar')    编译com.android.support:support-v4:19.0.1
    编译com.android.support:appcompat-v7:19.0.1
}安卓{
    packagingOptions {
        排除META-INF /相关内容
        排除META-INF /注意事项
        排除META-INF / LICENSE    排除META-INF / LICENSE.TXT
    排除META-INF / NOTICE.txt
}

}

这是如何使其工作有什么想法?现在,它的工作原理gradle这个端..但它不会编译:

错误code:139

 依靠包装来定义主神器的延伸已经去precated,并计划在摇篮2.0被删除
:cisalpina:compileDebugNdk UP-TO-DATE
:cisalpina:preBuild UP-TO-DATE
:cisalpina:preDebugBuild UP-TO-DATE
:cisalpina:preReleaseBuild UP-TO-DATE
:cisalpina:prepareComAndroidSupportAppcompatV71901Library UP-TO-DATE
:cisalpina:prepareDebugDependencies
:cisalpina:compileDebugAidl UP-TO-DATE
:cisalpina:compileDebugRenderscript UP-TO-DATE
:cisalpina:generateDebugBuildConfig UP-TO-DATE
:cisalpina:mergeDebugAssets UP-TO-DATE
:cisalpina:mergeDebugResources
:cisalpina:processDebugManifest UP-TO-DATE
:cisalpina:processDebugResources失败


解决方案

但问题是,有没有使用的资源的风格。删除它会让一切都正常工作。

I've tried to add the appcompat-v7 library for chaning the hint-color of the search bar. However I couldn't make it work. Any idea? This is my gradle file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.1'

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

apply plugin: 'android'

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.fasterxml.jackson.core:jackson-databind:2.2.+'
    compile 'com.fasterxml.jackson.core:jackson-core:2.2.+'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.+'
    compile 'commons-lang:commons-lang:2.6'
    compile 'com.nhaarman.listviewanimations:library:2.5.2'
    compile files('libs/TestFlightLib.jar')

    compile 'com.android.support:support-v4:19.0.1'
    compile 'com.android.support:appcompat-v7:19.0.1'
}

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'

    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}

}

Any idea on how to make it work? Now it works gradle-side.. but it doesn't compile:

Error code: 139

Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:cisalpina:compileDebugNdk UP-TO-DATE
:cisalpina:preBuild UP-TO-DATE
:cisalpina:preDebugBuild UP-TO-DATE
:cisalpina:preReleaseBuild UP-TO-DATE
:cisalpina:prepareComAndroidSupportAppcompatV71901Library UP-TO-DATE
:cisalpina:prepareDebugDependencies
:cisalpina:compileDebugAidl UP-TO-DATE
:cisalpina:compileDebugRenderscript UP-TO-DATE
:cisalpina:generateDebugBuildConfig UP-TO-DATE
:cisalpina:mergeDebugAssets UP-TO-DATE
:cisalpina:mergeDebugResources
:cisalpina:processDebugManifest UP-TO-DATE
:cisalpina:processDebugResources FAILED

解决方案

The problem was that there was a style not used by a resource. Deleting it will make everything work correctly.

这篇关于导入应用程序兼容性-V7 Android Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆