gpt4 book ai didi

android - Gradle 建筑找不到 attr 风格

转载 作者:行者123 更新时间:2023-11-30 02:32:17 25 4
gpt4 key购买 nike

最近我有一个错误,但更糟糕的是:我什么也没做!
当项目构建所有 gradle 文件时,我收到此错误日志:

Error:(3, 6) No resource found that matches the given name: attr 'style'.

Error:(3, 6) Execution failed for task ':hiperCotacao:processDebugResources'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Development\java-dev\sdk\build-tools\21.0.2\aapt.exe package -f --no-crunch -I C:\Development\java-dev\sdk\platforms\android-21\android.jar -M C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\res\debug -A C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\assets\debug -m -J C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\generated\source\r\debug -F C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package trilha.hipercot.activities -0 apk --output-text-symbols C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\symbols\debug Error Code: 1 Output: C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\res\debug\values\values.xml:1431: error: Error: No resource found that matches the given name: attr 'style'.

我正在使用:

Android Studio 1.0 RC 1
Build-tools v21.1.1
Min SDK Ver: 8
Target SDK Ver: 21
Using support-appcompat v4, v7. And also RecyclerView, CardView (All Maven resources)
Gradle Version: 2.1
Android Plugin Version: 0.14.4

这是“build.gradle”文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion '21.1.1'

defaultConfig {
applicationId "trilha.hipercot.activities"
minSdkVersion 8
targetSdkVersion 21
}

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

dependencies {
compile project(':recyclerviewstickysection')
compile project(':androidsupportv4preferencefragment')
compile files('libs/ormlite-android-4.48.jar')
compile files('libs/ormlite-core-4.48.jar')
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.android.support:recyclerview-v7:21.0.2'
compile 'com.android.support:cardview-v7:21.0.2'
}

错误指向:

<style name="Theme.HiperCotacao" parent="@style/Theme.AppCompat.Light">
//...
</style>



编辑

问题解决了这是我的“styles.xml”中的一行。类似的东西:

<item name="style">?attr/selectableItemBackground"</item>

奇怪的是:它没有指向问题的正确部分。然后之后:

<item name="android:foreground">?attr/selectableItemBackground</item>

最佳答案

您不能在样式中使用样式。另一种解决方案可能是将其他样式添加为父样式。

关于android - Gradle 建筑找不到 attr 风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27157592/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com