无法加载程序集';Xamarin.Android.Support.v4';

本文关键字:Android Support v4 Xamarin 加载 程序集 | 更新日期: 2023-09-27 18:29:06

我在visual studio 2015:中调试代码时遇到此错误

严重性代码描述项目文件行错误意外错误-请在以下位置提交错误报告http://bugzilla.xamarin.com.原因:System.IO.FileNotFoundException:未能加载程序集'Xamarin.Android.Support.v4,Version=,Culture=中性,PublicKeyToken='。也许它不存在于Android版的Mono中轮廓DTR_ACMS

我尝试重新安装Android Support Library v4。

我的代码:

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Support.V4.App;
using TaskStackBuilder = Android.Support.V4.App.TaskStackBuilder;
namespace DTR_ACMS
{
    [Activity(Label = "DTR_ACMS", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        int count = 1;
        private static readonly int ButtonClickNotificationId = 1000;
        private void ButtonOnClick(object sender, EventArgs eventArgs)
        {
            // Set up an intent so that tapping the notifications returns to this app:
            Intent intent = new Intent(this, typeof(MainActivity));
            // Create a PendingIntent; we're only using one PendingIntent (ID = 0):
            const int pendingIntentId = 0;
            PendingIntent pendingIntent =
                PendingIntent.GetActivity(this, pendingIntentId, intent, PendingIntentFlags.OneShot);
            // Build the notification:
            NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
                .SetAutoCancel(true)                    // Dismiss from the notif. area when clicked
                .SetContentTitle("Button Clicked")      // Set its title
                .SetNumber(count)                       // Display the count in the Content Info
                .SetSmallIcon(Resource.Drawable.ic_stat_button_click)  // Display this icon
                .SetContentText(String.Format(
                    "The button has been clicked {0} times.", count)); // The message to display.
            // Finally, publish the notification:
            NotificationManager notificationManager =
                (NotificationManager)GetSystemService(Context.NotificationService);
            notificationManager.Notify(ButtonClickNotificationId, builder.Build());
            // Increment the button press count:
            count++;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.button1);
            button.Click += ButtonOnClick;
        }
    }
}

无法加载程序集';Xamarin.Android.Support.v4';

Hi我也遇到了类似的问题,如果打开了一个文件,Visual studio会给出这样的错误。通过关闭该文件并重新启动Visual studio,它解决了我的问题。

https://forums.xamarin.com/discussion/67182/monodroid-error-xa0000-with-unexpected-error-with-reason-system-io-filenotfoundexception