IDE错误Android Studio 3.1.2"等待构建完成

时间:2018-05-02 12:22:24

标签: android android-studio

Hello Stack我收到以下错误:

  

空       显示java.lang.NullPointerException         在com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager.getRenderResult(LayoutlibSceneManager.java:602)         在com.android.tools.idea.uibuilder.surface.ScreenViewBase.getResult(ScreenViewBase.java:109)         在com.android.tools.idea.uibuilder.surface.ScreenView.getResult(ScreenView.java:30)         在com.android.tools.idea.uibuilder.menu.NavigationViewSceneView.getPreferredSize(NavigationViewSceneView.java:64)         在com.android.tools.idea.common.surface.SceneView.getPreferredSize(SceneView.java:95)         在com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager.createSceneViewsForMenu(LayoutlibSceneManager.java:265)         在com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager.doCreateSceneView(LayoutlibSceneManager.java:234)         在com.android.tools.idea.common.scene.SceneManager.createSceneView(SceneManager.java:73)         在com.android.tools.idea.common.scene.SceneManager。(SceneManager.java:66)         在com.android.tools.idea.uibuilder.scene.LayoutlibSceneManager。(LayoutlibSceneManager.java:157)         在com.android.tools.idea.uibuilder.surface.NlDesignSurface.createSceneManager(NlDesignSurface.java:145)         在com.android.tools.idea.common.surface.DesignSurface.setModel(DesignSurface.java:281)         在com.android.tools.idea.common.editor.NlEditorPanel.initNeleModelOnEventDispatchThread(NlEditorPanel.java:143)         在com.android.tools.idea.common.editor.NlEditorPanel.lambda $ null $ 4(NlEditorPanel.java:139)         在com.intellij.openapi.project.DumbServiceImpl.lambda $ smartInvokeLater $ 7(DumbServiceImpl.java:366)         在com.intellij.openapi.application.TransactionGuardImpl $ 2.run(TransactionGuardImpl.java:315)         在com.intellij.openapi.application.impl.LaterInvocator $ FlushQueue.runNextEvent(LaterInvocator.java:424)         在com.intellij.openapi.application.impl.LaterInvocator $ FlushQueue.run(LaterInvocator.java:407)         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)         at java.awt.EventQueue.access $ 500(EventQueue.java:98)         at java.awt.EventQueue $ 3.run(EventQueue.java:715)         at java.awt.EventQueue $ 3.run(EventQueue.java:709)         at java.security.AccessController.doPrivileged(Native Method)         at java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)         at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)         在com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)         在com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)         在com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)         在java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

我使用以下视图

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:showIn="navigation_view">

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_home"
            android:icon="@drawable/ic_home_black_24dp"
            android:title="Hoofdmenu" />
        <item
            android:id="@+id/nav_logout"
            android:icon="@drawable/ic_close_black_24dp"
            android:title="Uitloggen" />
        <item
            android:id="@+id/nav_gallery"
            android:icon="@drawable/ic_menu_gallery"
            android:title="Gallery"
            android:visible="false" />
        <item
            android:id="@+id/nav_slideshow"
            android:icon="@drawable/ic_menu_slideshow"
            android:title="Slideshow"
            android:visible="false" />
        <item
            android:id="@+id/nav_manage"
            android:icon="@drawable/ic_menu_manage"
            android:title="Tools"
            android:visible="false" />
    </group>

    <item
        android:title="Communicate"
        android:visible="false">
        <menu>
            <item
                android:id="@+id/nav_share"
                android:icon="@drawable/ic_menu_share"
                android:title="Share" />
            <item
                android:id="@+id/nav_send"
                android:icon="@drawable/ic_menu_send"
                android:title="Send" />
        </menu>
    </item>

</menu>

将我的IDE更新为3.1.2后,我现在在main_drawer活动

上收到此错误

任何帮助都将不胜感激。

修改 显然是行

tools:showIn="navigation_view"

崩溃预览

0 个答案:

没有答案