title: No resources found that matches the given name Xamarin Android
body: <p>I am trying to implement a file provider in <em>Xamarin.Forms</em>, and I am having an issue loading my file paths file. Whenever I attempt to build that app, I get the following error:</p>
  
  <blockquote>
    <p>No resource found that matches the given name (at 'resource' with
    value '@xml/file_paths')</p>
  </blockquote>
  
  <p>The <em>file_paths.xml</em> file is located in the resources directory under the xml folder. Any help would greatly appreciated. Here are my relevant files:</p>
  
  <p>Android Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" package="com.mycompany.myapp" android:versionName="1" android:installLocation="internalOnly"&gt;
  &lt;uses-sdk android:targetSdkVersion="26" /&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;application android:icon="@drawable/advanced" android:label="FD CANNECT" android:windowSoftInputMode="adjustPan" android:descendantFocusability="afterDescendants" &gt;
      &lt;provider 
        android:name="android.support.v4.content.FileProvider" 
        android:authorities="com.myapp.fileprovider" 
        android:exported="false" 
        android:grantUriPermissions="true"&gt;
          &lt;meta-data 
            android:name="android.support.FILE_PROVIDER_PATHS" 
            android:resource="@xml/file_paths" /&gt;
      &lt;/provider&gt;
  &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>file_paths.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;external-path name="downloads" path="downloads/" /&gt;
  &lt;/paths&gt;
  </code></pre>
  
  <p>MainActivity.cs</p>
  
  <pre><code>using Android.Provider;
  using Android.Support.V4.Content;
  using CAN2LAN.Droid;
  using Java.Lang;
  
  [assembly: Xamarin.Forms.Dependency(typeof(ShareIntent))]
  
  namespace CAN2LAN.Droid
  {
  using Acr.UserDialogs;
  using System.Linq;
  using Xamarin.Forms;
  
  using Xamarin.Forms.Platform.Android;
  
  global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
  {
      protected override void OnCreate(Bundle bundle)
      {
          TabLayoutResource = Resource.Layout.Tabbar;
          ToolbarResource = Resource.Layout.Toolbar;
  
          UserDialogs.Init(this);
          base.OnCreate(bundle);
          global::Xamarin.Forms.Forms.Init(this, bundle);
  
          Downloaded();
  
          Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =&gt; {
              args.Handled = false;
          };
  
          this.LoadApplication(new App());
      }
  
      public void Downloaded() {
          CrossDownloadManager.Current.PathNameForDownloadedFile = new System.Func&lt;IDownloadFile, string&gt;(file =&gt; {
              string fileName = Android.Net.Uri.Parse(file.Url).Path.Split('/').Last();
              return System.IO.Path.Combine(Environment.GetExternalStoragePublicDirectory(Environment.DirectoryDownloads).AbsolutePath, fileName);
          });
      }
  
  
  }
  
  public class ShareIntent : IShareable {
      public void OpenShareIntent(string fileName) {         
          OpenFile(fileName);
      }
  
      public void OpenFile(string fileName) {
          string auth = "com.myapp.fileprovider";
          System.Diagnostics.Debug.WriteLine("Auth is " + auth);
          string mimeType = Android.Webkit.MimeTypeMap.Singleton.GetMimeTypeFromExtension(Android.Webkit.MimeTypeMap.GetFileExtensionFromUrl(fileName.ToLower()));
          if (mimeType == null)
              mimeType = "*/*";
          Android.Net.Uri uri = null;
          System.Diagnostics.Debug.WriteLine("Created authentication and mime type");
          var file = new Java.IO.File(System.IO.Path.Combine(Environment.GetExternalStoragePublicDirectory(Environment.DirectoryDownloads).AbsolutePath, fileName));
          System.Diagnostics.Debug.WriteLine("File size is " + file.TotalSpace);
          System.Diagnostics.Debug.WriteLine("Froms context is " + Forms.Context);
          try {
               uri = FileProvider.GetUriForFile(Forms.Context, auth, file);
          }
          catch (Exception e)
          {
              System.Diagnostics.Debug.WriteLine("Exception " + e);
          }
  
          System.Diagnostics.Debug.WriteLine("URI is "  + uri);
  
  
          Intent intent = new Intent(Intent.ActionView);
          intent.SetDataAndType(uri, mimeType);
          intent.AddFlags(ActivityFlags.GrantReadUriPermission | ActivityFlags.GrantWriteUriPermission);
          intent.AddFlags(ActivityFlags.NewTask | ActivityFlags.NoHistory);
  
          System.Diagnostics.Debug.WriteLine("Intent is created");
          // Trying to allow writing to the external app ...
          var resInfoList = Forms.Context.PackageManager.QueryIntentActivities(intent, PackageInfoFlags.MatchDefaultOnly);
          foreach (var resolveInfo in resInfoList) {
              var packageName = resolveInfo.ActivityInfo.PackageName;
              Forms.Context.GrantUriPermission(packageName, uri, ActivityFlags.GrantWriteUriPermission | ActivityFlags.GrantPrefixUriPermission | ActivityFlags.GrantReadUriPermission);
          }
          System.Diagnostics.Debug.WriteLine("We have created res info lsit");
          try
          {
              System.Diagnostics.Debug.WriteLine("We are about to show the intent");
              Forms.Context.StartActivity(intent);
              System.Diagnostics.Debug.WriteLine("We ahe shwoed the intent");
  
          }
          catch (Exception e)
          {
              System.Diagnostics.Debug.WriteLine("We have caugth an exception " + e);
          }
  
  
      }
  }
  }
  </code></pre>