我刚刚安装了 Android Studio 3 Preview Canary 6。由于以下错误,我无法预览 activity_main.xml 中的 xml 布局:
- 渲染问题
- 无法实例化一个或多个类
当我安装 Canary 5 时也发生了这种情况。我认为升级到 Canary 6 可以解决这个问题,但事实并非如此。请帮我修复它,以便我可以开始构建我的应用程序。
这是我的 XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.companyname.zooapp.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>