首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android项目已经停止构建。检索项的父级错误: android:TextAppearance.Material.Widget.Button.Inverse

Android项目已经停止构建。检索项的父级错误: android:TextAppearance.Material.Widget.Button.Inverse
EN

Stack Overflow用户
提问于 2016-01-16 08:50:28
回答 1查看 216关注 0票数 0

在过去的两年里,我一直在从事一个项目,从去年开始,我就把它搬到了Android (我现在使用的是Android 1.5.1 )。就在今天,当我打开该项目以运行它时,我发现了检索项目父级的错误: android:TextAppearance.Material.Widget.Button.Inverse和android:Widget.MaterialButton.Colored错误。以下是我的app.gradle文件:

代码语言:javascript
复制
import org.apache.tools.ant.taskdefs.condition.Os

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.opaxlabs.boatbrat"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 20
        versionName '2.0'
        multiDexEnabled true
//        ndk {
//            moduleName "password"
//            abiFilter "all"
//        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

    dexOptions{
        preDexLibraries = false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

//    sourceSets.main.jni.srcDirs = [] // disable automatic ndk-build call, which ignore our Android.mk
//    sourceSets.main.jniLibs.srcDir 'src/main/libs'
//
//    // call regular ndk-build(.cmd) script from app directory
//    task ndkBuild(type: Exec) {
//        workingDir file('src/main')
//        commandLine getNdkBuildCmd()
//    }
//
//    tasks.withType(JavaCompile) {
//        compileTask -> compileTask.dependsOn ndkBuild
//    }
//
//    task cleanNative(type: Exec) {
//        workingDir file('src/main')
//        commandLine getNdkBuildCmd(), 'clean'
//    }
//
//    clean.dependsOn cleanNative

//    splits {
//        abi {
//            enable true
//            reset()
//            include 'x86', 'armeabi-v7a', 'mips'
//            universalApk true
//        }
//    }
}

//repositories {
//    jcenter()
//    maven { url "http://dl.bintray.com/webactive/maven" }
//}

//def getNdkDir() {
//    if (System.env.ANDROID_NDK_ROOT != null)
//        return System.env.ANDROID_NDK_ROOT
//
//    Properties properties = new Properties()
//    properties.load(project.rootProject.file('local.properties').newDataInputStream())
//    def ndkdir = properties.getProperty('ndk.dir', null)
//    if (ndkdir == null)
//        throw new GradleException("NDK location not found. Define location with ndk.dir in the local.properties file or with an ANDROID_NDK_ROOT environment variable.")
//
//    return ndkdir
//}
//
//def getNdkBuildCmd() {
//    def ndkbuild = getNdkDir() + "/ndk-build"
//    if (Os.isFamily(Os.FAMILY_WINDOWS))
//        ndkbuild += ".cmd"
//
//    return ndkbuild
//}

repositories {
    jcenter()
    maven { url "http://dl.bintray.com/webactive/maven" }
}

dependencies {
    compile 'com.android.support:multidex:1.0.0'
//    compile 'com.android.support:support-v4:+'
    compile 'com.google.android.gms:play-services:+'
//                {
//            exclude module: 'play-services-analytics'
//        }
//        compile ('com.google.android.gms:play-services-analytics:7.3.0')
    compile 'com.android.support:appcompat-v7:22.+'
//    compile 'com.stripe:stripe-android:+'
//    compile files('libs/PayPal_MPL.jar')
    compile files('libs/cwac-adapter-1.0.2.jar')
    compile files('libs/devsmartlib.jar')
    compile files('libs/fluent-hc-4.3.3.jar')
    compile files('libs/httpasyncclient-4.0.1.jar')
    compile files('libs/httpasyncclient-cache-4.0.1.jar')
    compile files('libs/httpclient-4.3.2.jar')
    compile files('libs/httpclient-cache-4.3.1.jar')
    compile files('libs/httpcore-4.3.2.jar')
    compile files('libs/httpmime-4.3.3.jar')
    compile files('libs/universal-image-loader-1.9.2-with-sources.jar')
    compile files('libs/endless-1.2.3.jar')
    compile files('libs/jncryptor-1.2.0.jar')
    compile files('libs/commons-codec-1.7-SNAPSHOT-android.jar')
    compile 'com.eway.payment:android-sdk:1.1'
}

我使用的是较低版本的构建工具,因为项目中有很多不推荐的代码,使用以后的工具和sdk可能会使问题复杂化。我甚至尝试使用版本23构建,但这并没有帮助。我尝试了以下几种方法:,但它们实际上是在说我已经做过的事情。任何帮助都将不胜感激。提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-01-16 08:52:38

因为你在用

代码语言:javascript
复制
compile 'com.google.android.gms:play-services:+'

您使用的是最新版本的compile 'com.google.android.gms:play-services:8.4.0',它与支持库v23有依赖关系。

您必须使用API 23.编译

更改这一行:

代码语言:javascript
复制
 compileSdkVersion 23

一般来说,并不是一个很好的实践--在依赖项中使用 +,因为将来不能用相同的库复制构建,而且您也不知道使用的是哪个版本。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34825179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档