Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception raised during rendering: 16 (Details)

preview in Android Studio doesn't work. Tried to change API, but without results.

Exception raised during rendering: 16 (Details)

java.lang.ArrayIndexOutOfBoundsException: 16
    at android.text.StaticLayout.generate(StaticLayout.java:854)
    at android.text.StaticLayout.<init>(StaticLayout.java:603)
    at android.text.StaticLayout.<init>(StaticLayout.java:50)
    at android.text.StaticLayout$Builder.build(StaticLayout.java:425)
    at android.widget.TextView.makeNewLayout(TextView.java:8272)
    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)
like image 301
Miszu96 Avatar asked Oct 21 '18 14:10

Miszu96


1 Answers

I had the same issue in my custom view with TextInputEditText field (btw it was com.google.android.material.textfield.TextInputEditText).

There was problem with android:hint="@string/long_hint_descr". You removed a couple of words from string.xml for long_hint_descr and error was gone.

But easiest way is to add tools:hint="short hint" with short string and keep original long in strings.

like image 174
validcat Avatar answered Sep 24 '22 02:09

validcat