使用Xamarin和VS 2015 Pro启动新PC我收到以下错误:
尝试初始化Android Designer时发生意外错误.请在工具 - >选项 - > Xamarin-> Android设置菜单上验证Android SDK路径和Java Development Kit路径.有关更多详细信息,请参阅日志.
我确认SDK已正确安装.VS没有生成任何类型的活动日志,因此我认为日志必须位于其他地方.任何人都知道我在哪里可以找到这个日志以找出更多关于什么是错的?
今天打开 Android Studio 时,我感到惊讶 - 我看不到布局的预览:
我认为这只是一个简单的修复:
尽管这些都没有解决问题。
我也遇到过其他人遇到的渲染问题,并尝试了各种解决方案,尽管我仍然遇到问题。
奇怪的是,每当我TextInputLayout从布局中删除小部件时,渲染问题就会消失:
(以下是导致问题的布局之一。)
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
android:id="@+id/fragmentNewCanvas_rootLayout"
tools:context=".fragments.newcanvas.NewCanvasFragment">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/fragmentNewCanvas_projectTitleTextInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:hint="@string/fragmentNewCanvas_project_name_str"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/fragmentNewCanvas_projectTitleTextInputEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/fragmentNewCanvas_spanCountTextInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:hint="@string/fragmentNewCanvas_span_count_str"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/fragmentNewCanvas_projectTitleTextInputLayout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/fragmentNewCanvas_spanCountTextInputEditText"
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<Button
android:id="@+id/fragmentNewCanvas_doneButton"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginBottom="24dp"
android:text="@string/str_button_done"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
这是演示问题的 gif:
不包含TextInputLayout渲染的布局很好,但包含渲染的布局会引起问题。
堆栈跟踪: …