如何解决Android Studio 3上链接文件资源失败的错误?

时间:2017-11-02 08:25:16

标签: android android-gradle android-studio-3.0

我已切换到Android Studio 3。 在我修复了许多问题之后,我遇到了这些错误:

enter image description here

enter image description here

为什么我的布局中会出现此错误?

当我评论"@style/TextAppearance.StatusBar.EventContent"时,重建后会再次取消注释。

在此布局页面上方有一个注释:

  

生成构建文件夹下的文件,不应编辑

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

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="right"
    android:paddingRight="15dp"
    android:text="سامانه پایش همراه"
    android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
    android:textSize="18sp"
    android:textStyle="bold" />

这是complete布局,
你可以从this link看到整个Gradle配置 这是我的Gradle项目。

1 个答案:

答案 0 :(得分:3)

我没有看到TextAppearance.StatusBar.Even tContent已定义在你的风格中:将其更改为已定义的样式,或者如果不需要则将其删除