我在 Android Studio 上遇到这个错误。
呈现问题注意:此项目包含 Java 编译错误,这可能会导致自定义 View 呈现失败。首先修复编译问题。 找不到以下类:
<com.makeuprewardz.app.ui.view.BottomBar (Fix Build Path, Edit XML, Create Class)
提示:尝试构建项目。
这是我的 XML 文件
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fancy="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fl_container"
android:layout_marginBottom="@dimen/bottombar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:layout_width="match_parent"
android:background="@drawable/actionbar_shadow_up"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/bottombar_height"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
<com.makeuprewardz.app.ui.view.BottomBar
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="@dimen/bottombar_height"
android:layout_gravity="bottom" />
最佳答案
确保您在项目的 gradle 文件中添加了自定义 View 的依赖项。
关于android - 呈现问题注意 : This project contains Java compilation errors,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45259025/