【问题标题】:Android studio not building projectAndroid Studio 未构建项目
【发布时间】:2019-04-26 18:13:51
【问题描述】:

Android 资源链接失败 输出:错误:找不到资源样式/Theme.AppCompat.Light.NoActionBar(又名 com.weiuit.LumnKey:style/Theme.AppCompat.Light.NoActionBar)。 错误:找不到资源样式/Theme.AppCompat.Light.NoActionBar(又名 com.weiuit.LumnKey:style/Theme.AppCompat.Light.NoActionBar)。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:590: 错误:样式属性 'attr/colorPrimary (aka com.weiuit.LumnKey: attr/colorPrimary)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:591: 错误:样式属性 'attr/colorPrimaryDark (aka com.weiuit.LumnKey: attr/colorPrimaryDark)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:592: 错误:样式属性 'attr/colorAccent (aka com.weiuit.LumnKey: attr/colorAccent)' 未找到。 错误:找不到资源样式/Theme.AppCompat.DayNight.DarkActionBar(又名 com.weiuit.LumnKey:style/Theme.AppCompat.DayNight.DarkActionBar)。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:603: 错误:样式属性'attr/colorPrimary (aka com.weiuit.LumnKey: attr/colorPrimary)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:604: 错误:样式属性 'attr/colorPrimaryDark (aka com.weiuit.LumnKey: attr/colorPrimaryDark)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:605: 错误:样式属性 'attr/colorAccent (aka com.weiuit.LumnKey: attr/colorAccent)' 未找到。 错误:找不到资源样式/Widget.AppCompat.SeekBar(又名 com.weiuit.LumnKey:style/Widget.AppCompat.SeekBar)。 错误:找不到资源样式/Widget.AppCompat.SeekBar(又名 com.weiuit.LumnKey:style/Widget.AppCompat.SeekBar)。 错误:找不到资源样式/Theme.AppCompat.Light.Dialog(又名 com.weiuit.LumnKey:style/Theme.AppCompat.Light.Dialog)。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:621: 错误:样式属性'attr/colorPrimary (aka com.weiuit.LumnKey: attr/colorPrimary)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:622: 错误:样式属性 'attr/colorPrimaryDark (aka com.weiuit.LumnKey: attr/colorPrimaryDark)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:623: 错误:样式属性 'attr/colorAccent (aka com.weiuit.LumnKey: attr/colorAccent)' 未找到。 E:\usman repository\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:624: 错误:样式属性 'attr/windowNoTitle (aka com.weiuit.LumnKey: attr/windowNoTitle)' 未找到。 错误:链接引用失败。

命令:C:\Users\Dell.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a5773728be23c4c145526f1a4035dad1\aapt2-3.2.1-4818971-windows\aapt2。 exe链接-I\ C:\Users\Dell\AppData\Local\Android\Sdk\platforms\android-28\android.jar\ - 显现\ E:\usman 存储库\office\lumnkey\LumnKeyStudio\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ E:\usman 存储库\office\lumnkey\LumnKeyStudio\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @E:\usman 存储库\office\lumnkey\LumnKeyStudio\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --自动添加覆盖\ --java\ E:\usman 存储库\office\lumnkey\LumnKeyStudio\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --自定义包\ com.weiuit.LumnKey\ -0\ APK\ --首选密度\ xxxhdpi\ --输出文本符号\ E:\usman 存储库\office\lumnkey\LumnKeyStudio\app\build\intermediates\symbols\debug\R.txt\ --no-version-vectors 守护进程:AAPT2 aapt2-3.2.1-4818971-windows 守护进程#0

我尝试了所有方法 .invalidate Cashe / restart ,清理,降级依赖项,我在许多旧项目中都面临这个问题。

【问题讨论】:

    标签: android xml styles


    【解决方案1】:

    我认为您尚未在 style.xml 中创建“style/Theme.AppCompat.Light.NoActionBar”样式,并且您正在清单中使用该样式。使用此名称在清单中创建一种样式或使用任何默认的 NoActionBar 样式

    看看我的应用风格

    <style name="AppThemeWhite" parent="Theme.AppCompat.Light.NoActionBar">
            <!-- Customize your theme here. -->
            <item name="colorPrimary">@color/primary</item>
            <item name="colorPrimaryDark">@color/primaryDark</item>
            <item name="colorAccent">@color/app_them_colore</item>
        </style>
    

    【讨论】:

    • 感谢您的回答,但我在 xml 中有 style/Theme.AppCompat.Light.NoActionBar"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-02
    • 1970-01-01
    • 2013-10-14
    • 2021-12-19
    相关资源
    最近更新 更多