Search code examples
androidandroid-studiokotlinandroid-architecture-navigationandroid-safe-args

error on generateSafeArgsDebug task execution, XmlPullParserException only whitespace content allowed


I had a project in which had three navigation graph xml files, than I deleted one file from file explorer window, after that I had a problem with building the project.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateSafeArgsDebug'.
> org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) 

Then I reverted back the deleted file, but have same problem, also tried to clean project and invalidate cache/restart options several times with no luck


Solution

  • Fixed: if you had same error and have mac OS then try removing that file ../navigation/.DS_Store

    rm -r app/src/main/res/navigation/.DS_Store