Android Studio 2.3的布局预览问题
我不知道问题是什么。
有解决方法吗?
===配置开始===
os:mac 10.12.3
ide:version:2.3
compileSdkVersion:25
buildToolsVersion:25.0.2
supportLibraryVersion:25.3.0
===配置结束===
===错误报告开始===
17356
java.lang.ArrayIndexOutOfBoundsException: 17356
at org.jetbrains.org.objectweb.asm.ClassReader.readUnsignedShort(ClassReader.java:2322)
at org.jetbrains.org.objectweb.asm.ClassReader.getAttributes(ClassReader.java:2200)
at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:565)
at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
at com.android.tools.idea.rendering.ClassConverter.rewriteClass(ClassConverter.java:184)
at com.android.tools.idea.rendering.ClassConverter.rewriteClass(ClassConverter.java:77)
at com.android.tools.idea.rendering.RenderClassLoader.convertClass(RenderClassLoader.java:164)
at com.android.tools.idea.rendering.RenderClassLoader.loadClass(RenderClassLoader.java:148)
at com.android.tools.idea.rendering.RenderClassLoader.loadClassFile(RenderClassLoader.java:129)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClassFile(ModuleClassLoader.java:380)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClassFromModule(ModuleClassLoader.java:280)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClassFromModuleOrDependency(ModuleClassLoader.java:239)
at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:176)
at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:56)
at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:127)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:222)
at java.lang.Class.getDeclaredClasses0(Native Method)
at java.lang.Class.getDeclaredClasses(Class.java:1867)
at org.jetbrains.android.uipreview.ViewLoader.parseClass(ViewLoader.java:137)
at org.jetbrains.android.uipreview.ViewLoader.loadAndParseRClass(ViewLoader.java:647)
at org.jetbrains.android.uipreview.ViewLoader.loadAndParseRClassSilently(ViewLoader.java:581)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadAndParseRClass(LayoutlibCallbackImpl.java:682)
at com.android.tools.idea.rendering.RenderTask.<init>(RenderTask.java:178)
at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:241)
at com.android.tools.idea.uibuilder.model.NlModel.inflate(NlModel.java:362)
at com.android.tools.idea.uibuilder.model.NlModel.render(NlModel.java:554)
at com.android.tools.idea.uibuilder.model.NlModel$3.run(NlModel.java:599)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:260)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:274)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:229)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:222)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
at com.intellij.util.Alarm$Request.run(Alarm.java:389)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
at com.intellij.util.concurrency.BoundedTaskExecutor.runFirstTaskThenPollAndRunRest(BoundedTaskExecutor.java:178)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$000(BoundedTaskExecutor.java:40)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:197)
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)
===布局XML ===
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent”>
<android.support.design.widget.AppBarLayout>
<android.support.v7.widget.Toolbar />
<android.support.design.widget.TabLayout />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager />
</RelativeLayout>
答案 0 :(得分:3)
Android Studio更新后发生在我身上,以及我使用自定义组件的布局文件。
在Android Studio中,选择文件&gt;使缓存无效并重新启动
答案 1 :(得分:1)
EditText的提示或文本属性字符串长度不应超过18个字符。如果您无法避免这种情况,请使用@ string / mylongtext