android - 布局in layout 在基本布局文件夹中没有声明 [错误]
问题描述
迁移到 Android Studio 3.2 API 28 后,我的应用布局出现以下错误:
layout 中的布局在基本布局文件夹中没有声明;当在与此限定符不匹配的配置中查询资源时,这可能会导致崩溃
我收到此错误的布局之一是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@null" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:adjustViewBounds="true"
android:contentDescription="@string/hello_world"
android:src="@drawable/loading_top" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:adjustViewBounds="true"
android:contentDescription="@string/hello_world"
android:src="@drawable/loading_bottom" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/hello_world"
android:background="@color/white"
android:layout_marginBottom="5dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:src="@drawable/loading_logo" />
<ImageView
android:id="@+id/loading"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="center|center_vertical"
android:layout_marginBottom="0dp"
android:layout_marginTop="0dp"
android:contentDescription="@string/hello_world"
android:scaleType="fitXY"
android:src="@null" />
</FrameLayout>
</LinearLayout>
我在第一个 LinearLayout 的第一行得到错误。
有谁知道如何解决这个错误?
谢谢
更新:用什么解决了我的问题回答了我的问题
解决方案
就我而言,关闭并重新打开 Android Studio解决了这个问题。重建项目或清除缓存没有帮助。
推荐阅读
- php - php路由显示一个url的两个页面
- stata - 计算面板中的缺失值
- c# - 尝试评估 LINQ 查询参数表达式时引发异常
- javascript - Javascript递归函数改变对象结构
- clickhouse - 问:如何配置 ClickHouse 返回 NULL 而不是 0?
- r - 恢复导致内核恐慌的代码行
- subscribe - 在 DolphinDB 中启用订阅
- exception - 思科:如何路由已经在路由网络中的单个服务器 IP
- image - 在页面之间导航时图像组件闪烁 React Native + Expo
- apache-kafka - Kafka Streams 客户端库与 kafka 代理版本的兼容性