I'm new with android studio software development, when I start building new software, this error happens.
error: '0+id/nav_home' is incompatible with attribute android:id (attr) reference. Message{kind=ERROR, text=error: '0+id/nav_home' is incompatible with attribute android:id (attr) reference., sources=[C:\Users\Ray\AndroidStudioProjects\MyCatholic\app\src\main\res\menu\navigation_menu.xml:14], original message=, tool name=Optional.of(AAPT)}
and this is my code
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="0+id/nav_post"
android:title="Add New Post"
android:icon="@drawable/add_post"/>
<item
android:id="0+id/nav_profile"
android:title="My Profile"
android:icon="@drawable/profile_icon"/>
<item
android:id="0+id/nav_home"
android:title="Home"
android:icon="@drawable/home"/>
<item
android:id="0+id/nav_friends"
android:title="Friends"
android:icon="@drawable/friends"/>
<item
android:id="0+id/nav_find_friends"
android:title="Find Friends"
android:icon="@drawable/find_people"/>
<item
android:id="0+id/nav_message"
android:title="Message"
android:icon="@drawable/messages"/>
<item
android:id="0+id/nav_setting"
android:title="Settings"
android:icon="@drawable/settings"/>
<item
android:id="0+id/nav_logout"
android:title="Log Out"
android:icon="@drawable/logout"/>
</menu>
am I missing something ?
android:id="0+id/your_id"
isn't valid syntax. It's:
android:id="@+id/your_id"
Replace all 0+id
with @+id
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With