У меня похожая проблема при выполнении курса Kotlin для Android.
Когда я добавляю текст в многострочный текст (editText с типом ввода textMultiline), который длиннее, чем то, что можно увидеть в виджете, происходит сбой средства визуализации.Вот трассировка стека, предоставленная Android Studio:
16 View Measure Failed
java.lang.ArrayIndexOutOfBoundsException: 16
at android.text.StaticLayout.generate(StaticLayout.java:854)
at android.text.DynamicLayout.reflow(DynamicLayout.java:609)
at android.text.DynamicLayout.generate(DynamicLayout.java:477)
at android.text.DynamicLayout.<init>(DynamicLayout.java:396)
at android.text.DynamicLayout.<init>(DynamicLayout.java:45)
at android.text.DynamicLayout$Builder.build(DynamicLayout.java:278)
at android.widget.TextView.makeSingleLayout(TextView.java:8329)
at android.widget.TextView.makeNewLayout(TextView.java:8204)
at android.widget.TextView.onMeasure(TextView.java:8586)
at android.view.View.measure_Original(View.java:23169)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:23133)
at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at android.support.constraint.ConstraintLayout.onMeasure_Original(ConstraintLayout.java:1572)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java)
at android.view.View.measure_Original(View.java:23169)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:23133)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6749)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.support.v7.widget.ContentFrameLayout.onMeasure_Original(ContentFrameLayout.java:143)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java)
at android.view.View.measure_Original(View.java:23169)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:23133)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6749)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure_Original(ActionBarOverlayLayout.java:401)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java)
at android.view.View.measure_Original(View.java:23169)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:23133)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure_Original(View.java:23169)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:23133)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:592)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:345)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:386)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:450)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:590)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
и
16 Exception raised during rendering
java.lang.ArrayIndexOutOfBoundsException: 16
at android.text.StaticLayout.generate(StaticLayout.java:854)
at android.text.DynamicLayout.reflow(DynamicLayout.java:609)
at android.text.DynamicLayout.generate(DynamicLayout.java:477)
at android.text.DynamicLayout.<init>(DynamicLayout.java:396)
at android.text.DynamicLayout.<init>(DynamicLayout.java:45)
at android.text.DynamicLayout$Builder.build(DynamicLayout.java:278)
at android.widget.TextView.makeSingleLayout(TextView.java:8329)
at android.widget.TextView.makeNewLayout(TextView.java:8204)
at android.widget.TextView.assumeLayout(TextView.java:8104)
at android.widget.TextView.onPreDraw(TextView.java:6742)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977)
at android.view.AttachInfo_Accessor.dispatchOnPreDraw(AttachInfo_Accessor.java:46)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:404)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:543)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:426)
at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:108)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:154)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:136)
at com.android.tools.idea.rendering.RenderTask.lambda$renderInner$5(RenderTask.java:671)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Вот мой макет:
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView" android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="16dp"/>
<Button
android:text="Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="16dp" app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="16dp"
android:id="@+id/cancelButton"/>
<Button
android:text="OK"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/okButton"
app:layout_constraintEnd_toStartOf="@+id/cancelButton"
android:layout_marginEnd="32dp"
app:layout_constraintBaseline_toBaselineOf="@+id/cancelButton"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:ems="10"
android:id="@+id/editText2"
android:text='Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
app:layout_constraintStart_toEndOf="@+id/textView"
android:layout_marginStart="16dp" android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/textView" android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="16dp"
app:layout_constraintBottom_toTopOf="@+id/okButton"/>
Я использую Android Studio 3.2.1
Конечно, виджет имел высоту, превышающую размер экрана, что приводило к его переполнению за пределами главного экрана дизайнера, в моем случае он просто падал.