elunap
elunap

Reputation: 841

Xamarin android No resource identifier found for attribute in package

I'm currently working on an android core app using xamarin, I have installed android support design 23.4.0.1, and Android.Support.v7.AppCompat 23.4.0.1

And the problem I'm having right now is in this lines:

    app:headerLayout="@layout/nav_header"
    app:menu="@layout/menu_navigation"

With the error "No resource identifier found for attribute in package"

I was reading some of the questions already answered in here, but still can't fix the error, maybe because I'm using xamarin, I don't know.

Full code in question:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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"
 android:id="@+id/drawer"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:fitsSystemWindows="true"
 tools:openDrawer="start">
 <android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.learn2crack.myapplication.MainActivity">
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary" />
    </android.support.design.widget.AppBarLayout>
    <include
        layout="@layout/listitem_device" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
    android:id="@+id/navigation_view"
    android:layout_height="match_parent"
    android:layout_width="wrap_content"
    android:layout_gravity="start"
    app:headerLayout="@layout/nav_header"
    app:menu="@layout/menu_navigation"/>
</android.support.v4.widget.DrawerLayout>

Note: I was using this tutorial: https://www.learn2crack.com/2016/03/android-material-design-sliding-navigation-drawer.html

Upvotes: 0

Views: 5626

Answers (3)

Helper
Helper

Reputation: 125

Change this:

xmlns:app|xmlns:local="http://schemas.android.com/apk/res-auto"

To this:

xmlns:app|xmlns:local="http://schemas.android.com/apk/lib/com.app.chasebank"

and build

Upvotes: 1

elunap
elunap

Reputation: 841

The problem was that I was using:

<android.support.v4.widget.DrawerLayout> 

Instead of:

</android.support.v7.widget.DrawerLayout> 

Now my code works.

Upvotes: 0

Jon Douglas
Jon Douglas

Reputation: 13176

Did you add the app: namespace ontop of your control?

xmlns:app="http://schemas.android.com/apk/res-auto"

Upvotes: -1

Related Questions