简体   繁体   English

布局未在 Android Studio 中呈现

[英]Layout not rendering in Android Studio

I was trying out some projects in Android Studio and I came across this error which I am not able to figure out.我在 Android Studio 中尝试一些项目时遇到了这个我无法弄清楚的错误。 One of the layouts in the app is not rendering in the IDE. But it is visible if I run the app.应用程序中的布局之一未在 IDE 中呈现。但如果我运行该应用程序,它是可见的。 There are no issues with other layouts in the app.应用程序中的其他布局没有问题。 Only the main layout, activity_main.xml has the problem.只有主要布局,activity_main.xml 有问题。 It is showing the following errors as well.它还显示以下错误。

java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException

java.lang.StringIndexOutOfBoundsException: String index out of range: -1 java.lang.StringIndexOutOfBoundsException:字符串索引超出范围:-1

I already tried deleting Android Studio and Gradle cache, Clean, and Rebuild.我已经尝试删除 Android Studio 和 Gradle 缓存、清理和重建。 Invalidate Caches / Restart did not work as well.使缓存无效/重新启动也不起作用。

Please help me with this as I am stuck in my self-learning of Andriod development.请帮助我解决这个问题,因为我一直在自学 Andriod 开发。

截屏

Delete below line from all EditText tags从所有EditText标签中删除以下行

android:autofillHints="" 

XML Rendering will work fine. XML 渲染工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM