4

I'm racking my brains over this. I'm trying to refactor my app to use the new Navigation Architecture Component in Android Studio Canary 15, all I get when creating the xml file is the following message, the editor never shows up;

enter image description here

I have already uninstalled and re-installed both my installation of Android Studio and Android Studio Canary 15 (residing in both C:\Program Files\Android\Android Studio and C:\Program Files\Android\Android Studio Canary and all related components in the C:\Users\[username]\.AndroidStudio folders.

Any ideas why this isn't working?

EDIT: Ok so there is now an error message, when I disable the Android Support Plugin I get a few more error messages telling me to re-enable plugins!

EDIT 2: I updated to Canary 16 and the issue still remains.

26/05/2018
18:22   Plugin Error
            Problems found loading plugins:
            Plugin "Android Games" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Android NDK Support" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Android APK Support" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Google Developers Samples" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Google Cloud Tools For Android Studio" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Test Recorder" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Firebase Testing" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Google Services" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Firebase Services" was not loaded: required plugin "Android Support" is disabled.
            Plugin "App Links Assistant" was not loaded: required plugin "Android Support" is disabled.
            Plugin "Fire... (show balloon)

18:23   Error Loading Project: Cannot load 3 facets Details...

18:23   Plugins Suggestion
            Plugin supporting features (Run Configuration[Android App], Facet[android, android-gradle]) is currently disabled.
            Enable plugins...
            Ignore Unknown Features
null
java.lang.IllegalStateException
    at com.android.tools.idea.naveditor.scene.decorator.NavSceneDecoratorFactory.<init>(NavSceneDecoratorFactory.kt:39)
    at com.android.tools.idea.naveditor.scene.NavSceneManager.getSceneDecoratorFactory(NavSceneManager.java:510)
    at com.android.tools.idea.common.scene.SceneComponent.<init>(SceneComponent.java:116)
    at com.android.tools.idea.common.scene.SceneManager.createHierarchy(SceneManager.java:164)
    at com.android.tools.idea.naveditor.scene.NavSceneManager.createHierarchy(NavSceneManager.java:265)
    at com.android.tools.idea.common.scene.SceneManager.update(SceneManager.java:121)
    at com.android.tools.idea.naveditor.scene.NavSceneManager.requestRender(NavSceneManager.java:340)
    at com.android.tools.idea.common.surface.DesignSurface.requestRender(DesignSurface.java:1291)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.layoutContent(NavDesignSurface.java:227)
    at com.android.tools.idea.common.surface.DesignSurface.setScale(DesignSurface.java:730)
    at com.android.tools.idea.common.surface.DesignSurface.setScale(DesignSurface.java:683)
    at com.android.tools.idea.common.surface.DesignSurface.zoom(DesignSurface.java:571)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.zoom(NavDesignSurface.java:402)
    at com.android.tools.idea.common.surface.DesignSurface.zoom(DesignSurface.java:513)
    at com.android.tools.idea.common.surface.DesignSurface.zoomToFit(DesignSurface.java:631)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.refreshRoot(NavDesignSurface.java:521)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.getCurrentNavigation(NavDesignSurface.java:233)
    at com.android.tools.idea.naveditor.scene.NavSceneManager.getRoot(NavSceneManager.java:241)
    at com.android.tools.idea.common.scene.SceneManager.update(SceneManager.java:115)
    at com.android.tools.idea.naveditor.scene.NavSceneManager.requestRender(NavSceneManager.java:340)
    at com.android.tools.idea.common.surface.DesignSurface.requestRender(DesignSurface.java:1291)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.layoutContent(NavDesignSurface.java:227)
    at com.android.tools.idea.common.surface.DesignSurface.addModel(DesignSurface.java:310)
    at com.android.tools.idea.common.surface.DesignSurface.setModel(DesignSurface.java:368)
    at com.android.tools.idea.common.editor.NlEditorPanel.initNeleModelOnEventDispatchThread(NlEditorPanel.java:162)
    at com.android.tools.idea.common.editor.NlEditorPanel.lambda$null$4(NlEditorPanel.java:149)
    at com.intellij.openapi.project.DumbServiceImpl.lambda$smartInvokeLater$7(DumbServiceImpl.java:430)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
    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)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:779)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:720)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:395)
    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)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

enter image description here

Edit 3: My navigation graph 'main_graph.xml' is below;

<?xml version="1.0" encoding="utf-8"?>

<navigation xmlns:android="http://schemas.android.com/apk/res/android">
</navigation>
omegaFlame
  • 245
  • 3
  • 9
  • 21

3 Answers3

7

You have the test helper dependence, try removing it. There's an issue with it and the navigation editor

androidTestImplementation "android.arch.navigation:navigation-testing:$nav_version"

Then hit restart and clean cache.

Levi Moreira
  • 11,917
  • 4
  • 32
  • 46
0

Go to IDE Settings and just disable and enable Android Support plugin like below:

  • Windows (and Linux): Go to File---> Settings---> Plugins ---> Enable Android Support

  • Mac: Android Studio---> Preferences---> Plugins ---> Enable Android Support

enter image description here

Paraskevas Ntsounos
  • 1,755
  • 2
  • 18
  • 34
  • Hi I have tried this (mentioned in question) and get errors saying to re-enable the plugin. Disabling and re-enabling does not fix the issue. – omegaFlame May 30 '18 at 12:44
  • ok, have you tried this too? https://stackoverflow.com/a/48083794/6176003 – Paraskevas Ntsounos May 30 '18 at 12:45
  • Thanks for the link. I have just tried all the mentioned solutions and still getting the error. – omegaFlame May 30 '18 at 13:05
  • @omegaFlame so your plugin screen is exactly like the photo? make sure again that you show All plugins and those with android support is enabled. – Paraskevas Ntsounos May 30 '18 at 13:17
  • Not exactly, I have more plugins than that and all Android Support plugins are enabled. – omegaFlame May 30 '18 at 13:27
  • @omegaFlame I found one other way too, go to File -> Settings -> Plugins and unselect red items, restart Android Studio, select "Android Support" and restart. I hope this work. – Paraskevas Ntsounos May 30 '18 at 14:20
  • They did not appear red until i disabled Android Support. I then disabled all red items and restarted. Then I enabled Android Support again and restarted and still getting the error. Plus now in 'Logcat' it says "Please configure Android SDK" – omegaFlame May 30 '18 at 14:29
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/172086/discussion-between-paraskevas-ntsounos-and-omegaflame). – Paraskevas Ntsounos May 30 '18 at 14:34
0

Posting, because I can not add comment(reputation). @Levi Moreira it's good starting point for me, but I had to remove some additional files. In my case it was :

-.idea/cashes - folder in project

-libraries/ - all navigation libraries

and start Android Studio.

human
  • 936
  • 6
  • 6
  • Welcome to SO. As you write, this isn't an answer; you should really wait until you have sufficient reputation to make comments. – Nick Jul 12 '18 at 13:09
  • What do you mean by saying that this is not the answer? This solution worked for me and helped me solve the problem. I just wanted to share it with others – human Jul 13 '18 at 11:41