【问题标题】:Facing issue when sdk version is updated in Android Studio在 Android Studio 中更新 sdk 版本时面临的问题
【发布时间】:2018-12-11 13:13:57
【问题描述】:

我正在使用对讲 sdk 版本 3.+ 进行通知。我需要将对讲 sdk 版本更新到 5.+。更新 gradle 文件中的 sdk 版本后,我遇到了以下错误。

AGPBI: {"kind":"error","text":"找不到与给定名称匹配的资源(在 \u0027textAppearance\u0027 处,值为 \u0027@style/TextAppearance.AppCompat.Notification\u0027)。" ,"来源":[{"文件":"C:\Users\Android-2\.android\build-cache\971cf0b344c5894d7c756a8e5b80dd3e25a942ef\output\res\layout\activity_add_source.xml","position":{"startLine": 32,"startColumn":40,"startOffset":1209,"endColumn":84,"endOffset":1253}}],"original":"","tool":"AAPT"} C:\用户\安卓 2\Desktop\Files\OriginalCode\android\app\build\intermediates\res\merged\debug\layout\activity_add_source.xml:28:错误:错误:未找到与给定名称匹配的资源(在 'textAppearance' 处,值为 ' @style/TextAppearance.AppCompat.Notification')。
:app:processDebugResources 失败 FAILURE:构建失败并出现异常。 * 什么地方出了错: 任务 ':app:processDebugResources' 执行失败。 com.android.ide.common.process.ProcessException: 无法执行 aapt

我还检查了不同的方法来解决上述问题。但我不能。如果我在 android studio 中创建了一个新项目并检查了对讲 sdk 版本 5.+。它接受并且没有问题。我只在我现有的应用程序中遇到过。请在这个问题上帮助我。

activity_add_source.xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

        <com.stripe.android.view.CardMultilineWidget
            android:id="@+id/add_source_card_entry_widget"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_margin="@dimen/add_card_total_margin"
            />

        <FrameLayout
            android:id="@+id/add_source_error_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/add_source_card_entry_widget"
            >

            <TextView
                android:id="@+id/tv_add_source_error"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/add_card_total_margin"
                android:textAppearance="@style/TextAppearance.AppCompat.Notification"
                android:visibility="gone"
                />
        </FrameLayout>
    </RelativeLayout>
</ScrollView> 

【问题讨论】:

  • 你能发布你的activity_add_source.xml

标签: android sdk intercom


【解决方案1】:

我认为您应该尝试在您的styles.xml 中添加以下样式

<style name="TextAppearance.AppCompat.Notification"> <item name="android:textSize">12sp</item> <item name="android:textColor">#ccc</item> </style>

注意:根据您的喜好更改文本和颜色

【讨论】:

    猜你喜欢
    • 2017-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-29
    • 2019-11-22
    • 2021-08-22
    • 1970-01-01
    相关资源
    最近更新 更多