Reputation: 270
I have a kotlin project and i used Navigation component.
in my local machine i can use gradle build
and it's work ok.
but in my remote ubuntu when i call gradle build
i get this message
can anyone help me
root@sarvdata:/home/test2/WooShop# gradle build Task :app:generateSafeArgsDebug FAILED
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)
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Upvotes: 22
Views: 7056
Reputation: 2788
I had a similar problem with the additional message:
simplenames must not contain empty items: []
Came out that I forgot to add some value to app:argType=""
inside my nav_graph_xml_file
Check your Navigation Graph file like @Abdulsalam Opeyemi mentioned above.
Upvotes: 1
Reputation: 983
I had the same error, after proper checking, I realized there was an error in my navigation graph's code. The error was gone after correctly formatting and correcting the error. I suggest you check your navigation graph's code for any misspellings or errors and if you are not using navigation then delete the graph entirely. The error is shown below.
WRONG:
<fragment
android:id="@+id/SecondFragment"
android:name="com.example.opeyemiabdulsalam.carowners.CarOwnersFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/car_owners_list">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
<argument
android:name="filterValue"
app:argType="com.example.opeyemiabdulsalam.data.Filter"
<!-- app:popEnterAnim="@anim/slide_in_left"-->
pop
app:popExitAnim="@anim/slide_out_right"/>
</fragment>
RIGHT:
<fragment
android:id="@+id/SecondFragment"
android:name="com.example.opeyemiabdulsalam.carowners.CarOwnersFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/car_owners_list">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
<argument
android:name="filterValue"
app:argType="com.example.opeyemiabdulsalam.data.Filter"
app:popEnterAnim="@anim/slide_in_left"
app:popExitAnim="@anim/slide_out_right"/>
</fragment>
Upvotes: 1
Reputation: 416
Got the same error. Did a search with grep -r "\x00" app/src/main/res
and a app/src/main/res/navigation/.DS_Store file came up. Deleted it and everything played out.
Upvotes: 24
Reputation: 66
I have this problem in Android Project with Navigation component and I have navigation dir with empty navigation xml file just remove navigation dir and rebuild then I can build.
Upvotes: 5
Reputation: 76699
something starting with \u0
seems the be escaped Unicode ...so this might be an encoding issue. searching XML files for string \u0
should locate the problematic file and shed some light on the actual cause.
Upvotes: 0
Reputation: 180
I faced the same problem. Trying to find xml file with this character but I think its generated by Safe Args gradle plugin. Solved problem by creating empty Android project and copied existing code and resources into this.
Upvotes: 0