找不到Gradle构建错误样式属性

时间:2017-11-15 16:20:49

标签: android gradle android-gradle styles

我尝试将android studio 2.3升级到3.0但是gradle无法构建并显示此消息: 可能你的一个库期待这种风格可用而且找不到它

请帮我解决此错误。

screenshot of the error message

这是项目的build.gradle

apply plugin: 'com.android.application'


repositories {
    maven {
        url 'https://repo1.maven.org/maven2/'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "com.skills.inuk"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "0.3.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true //important
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {

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

    }

    packagingOptions {
        exclude 'LICENSE.txt'
    }
    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    // compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.android.support:design:26.0.1'
    compile 'com.jakewharton:butterknife:8.6.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.twitter.sdk.android:twitter:3+'
    compile 'com.google.android.gms:play-services:11.4.2'
    compile 'com.makeramen:roundedimageview:2.3.0'
    compile 'com.github.curioustechizen.android-ago:library:1.3.4'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.google.code.gson:gson:2.6.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
    compile 'com.android.support:support-v4:26.0.1'
    compile 'com.android.support:support-vector-drawable:26.0.1'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.android.support:multidex:1.0.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
apply plugin: 'com.google.gms.google-services'  

对于你的回应家伙来说,我创建了这个问题,发生这种情况是因为:

考虑从android命名空间访问资源时是否错误地包含该符号,如下所示:

<!-- When referencing resources from the 'android' namespace, omit the '@' symbol. -->
<item name="@android:windowEnterAnimation"/>

2 个答案:

答案 0 :(得分:3)

转到gradle.properties编写以下代码并同步项目

android.enableAapt2=false

并删除@符号,因为来自Android Studio 3.0

  

当从'android'命名空间引用资源时,省略'@'符号。

答案 1 :(得分:0)

也许您想使用?android:attr/background?android:attr/textColor代替@android:attr/background@android:attr/textColor