由于我已将glide依赖项添加到gradle文件夹中,所以我的所有预览渲染都没有显示。我尝试使.ideas文件失效,重建,同步甚至删除。我也删除了添加的下滑依赖。但是,仍然没有成功。请帮忙,谢谢!!!
一些错误:
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.makeSingleLayout(TextView.java:8385)
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.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 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6749)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
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)
2。
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.makeSingleLayout(TextView.java:8385)
at android.widget.TextView.makeNewLayout(TextView.java:8204)
at android.widget.TextView.onMeasure(TextView.java:8586)
at androidx.appcompat.widget.AppCompatTextView.onMeasure_Original(AppCompatTextView.java:501)
at androidx.appcompat.widget.AppCompatTextView.onMeasure(AppCompatTextView.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.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1535)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1187)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:706)
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.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)
答案 0 :(得分:0)
我仍然遇到一些渲染问题,尤其是那些使用androidx函数的问题。但是,在重新安装android studio之后,我确实设法查看了大多数渲染。希望这对需要它的人有所帮助!
答案 1 :(得分:-2)
我遇到相同的java.lang.ArrayIndexOutOfBoundsException错误,并尝试运行“文件”>“使缓存无效”,然后重新启动。它对我不起作用。
我的布局预览不会显示,因为我在布局文件中有一个错误。要解决此问题,请尝试逐一注释掉布局XML文件中的每个组件。继续尝试,直到找出导致此错误的组件。
您的错误很可能是由EditView组件或其他与文本相关的组件引起的。