Bug 47441 - XML producing "Resource not found" error
Summary: XML producing "Resource not found" error
Status: RESOLVED UPSTREAM
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2016-11-18 23:32 UTC by maksymt1
Modified: 2017-07-05 18:01 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED UPSTREAM

Description maksymt1 2016-11-18 23:32:28 UTC
When I tried to implement a Navigation view using the following:

  <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:layout_gravity="start"
        android:fitsSystemWindows="true" 
        app:headerLayout="@layout/AccountDrawerHeader"
        app:menu="@menu/NavigationMenu"/>

I would receive the following errors:
No resource found that matches the given name (at 'menu' with value '@layout/AcountDrawerHeader').
No resource found that matches the given name (at 'menu' with value '@menu/NavigationMenu').

I was able to reproduce the error by naming the XML files that I made for the header layout and menu by naming the files, starting with a capital letter. This error was finally fixed when I changed the first letters of the xml file names to lowercase. The XML files were not found when the file names started with a capital letter. Changing the file names to lowercase fixed this issue.

Changed to:

  <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:layout_gravity="start"
        android:fitsSystemWindows="true" 
        app:headerLayout="@layout/account_drawer_header"
        app:menu="@menu/navigation_menu"/>



Version info:

Microsoft Visual Studio Community 2015
Version 14.0.25425.01 Update 3
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Community

Visual Basic 2015   00322-20000-00000-AA606
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA606
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA606
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-20000-00000-AA606
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.12.01117.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.11107.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.8.1   14.0.11123.0
Azure App Service Tools v2.8.1

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Xamarin   4.2.1.60 (47830f6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.2.37 (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 John Miller [MSFT] 2017-07-05 17:46:35 UTC
Android requires lowercase for these resource names. This is the same as when working in Android Studio. 

I did notice that if you do this in Android Studio it's considered invalid and the IDE will produce an error: "Layout name is not set to a valid resource name. File-based resource names must start with a lowercase letter."
Comment 2 John Miller [MSFT] 2017-07-05 18:01:12 UTC
I've filed some enhancements related to this: https://bugzilla.xamarin.com/show_bug.cgi?id=57953