1
java.lang.NullPointerException
    at org.jetbrains.android.dom.navigation.NavigationSchema$TypeRef.<init>(NavigationSchema.java:183)
    at org.jetbrains.android.dom.navigation.NavigationSchema.lambda$buildDestinationTypeToDestinationMap$2(NavigationSchema.java:531)
    at java.util.HashMap.forEach(HashMap.java:1288)
    at org.jetbrains.android.dom.navigation.NavigationSchema.buildDestinationTypeToDestinationMap(NavigationSchema.java:531)
    at org.jetbrains.android.dom.navigation.NavigationSchema.init(NavigationSchema.java:460)
    at org.jetbrains.android.dom.navigation.NavigationSchema.createIfNecessary(NavigationSchema.java:389)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.lambda$tryToCreateSchema$3(NavDesignSurface.java:370)
    at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:79)
    at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:123)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:977)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:116)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:79)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.tryToCreateSchema(NavDesignSurface.java:368)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.lambda$goingToSetModel$0(NavDesignSurface.java:278)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
    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)

The error is too long to post it here, so I only post the first page of the error. When I open android project in android studio 3.4.2 that has an empty, default starter code, navigation.xml file the IDE shows an alert, IDE Error Occurred. But my project synced successfully, what i can't do is opening the navigation in design tab, it says "Waiting for build to finish".

Henok Tesfaye
  • 8,287
  • 13
  • 47
  • 84
  • Finally, deleting the Android cache and invalidating the cache helped me. I got the answer in this link ,https://stackoverflow.com/questions/30684613/android-studio-xml-editor-autocomplete-not-working-with-support-libraries. – Henok Tesfaye Jul 22 '19 at 19:11

1 Answers1

0

Just don't use an empty file, but add the root node into there:

<?xml version="1.0" encoding="utf-8"?>
<navigation
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    app:startDestination="@id/someFragment"
    android:id="@+id/nav_graph">

</navigation>
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
  • Thank you @MartinZeitler. I tried but it doesn't work, and sorry for the confusion empty I mean default starter code that android studio generates. – Henok Tesfaye Jul 22 '19 at 15:37
  • 1
    @HenokTesfaye then there might be one of the fragments at fault, likely the one which is defined as `app:startDestination` (if not, try the usual "invalidate caches and restart"). – Martin Zeitler Jul 22 '19 at 23:51