Xamarin ClassNotFoundException路径列表

Xamarin ClassNotFoundException路径列表,xamarin,xamarin.android,Xamarin,Xamarin.android,我使用的是.NET标准的Xamarin解决方案,在android部分创建自己的类时,.apk中没有包含这些类 我得到以下例外情况: Java.Lang.ClassNotFoundException: Didn't find class "md51d6fa235ea481c9f9b4025a1ec847f9d.TestService" on path: DexPathList[[zip file "/data/app/com.gete.DriverApp-1/base.apk"],nativeLi

我使用的是.NET标准的Xamarin解决方案,在android部分创建自己的类时,.apk中没有包含这些类

我得到以下例外情况:

Java.Lang.ClassNotFoundException: Didn't find class "md51d6fa235ea481c9f9b4025a1ec847f9d.TestService" on path: DexPathList[[zip file "/data/app/com.gete.DriverApp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.gete.DriverApp-1/lib/arm64, /data/app/com.gete.DriverApp-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
我曾经检查过:

方法总数:27569

md51d6…
文件夹不在APK中,但当我选中
obj/Debug/android/bin/classes
时,文件夹就在那里

使用API版本:25

构建操作:编译

MainActivity.cs

[IntentFilter(new[] { Intent.ActionView },
    Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault },
    DataScheme = "test",
    DataHost = "open.rides",
    DataPathPrefix = "",
    AutoVerify = true)]
[Activity(Label = "DriverApp.Android", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
    protected override void OnCreate(Bundle bundle)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(bundle);

        global::Xamarin.Forms.Forms.Init(this, bundle);
        AndroidAppLinks.Init(this);

        LoadApplication(new App());

        var loci = new TestService();

    }
}
namespace DriverApp.Droid.Services
{
    class TestService : Service
    {
        public override IBinder OnBind(Intent intent)
        {
            throw new NotImplementedException();
        }
    }
}
服务/TestService.cs

[IntentFilter(new[] { Intent.ActionView },
    Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault },
    DataScheme = "test",
    DataHost = "open.rides",
    DataPathPrefix = "",
    AutoVerify = true)]
[Activity(Label = "DriverApp.Android", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
    protected override void OnCreate(Bundle bundle)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(bundle);

        global::Xamarin.Forms.Forms.Init(this, bundle);
        AndroidAppLinks.Init(this);

        LoadApplication(new App());

        var loci = new TestService();

    }
}
namespace DriverApp.Droid.Services
{
    class TestService : Service
    {
        public override IBinder OnBind(Intent intent)
        {
            throw new NotImplementedException();
        }
    }
}

解决方案是从测试设备手动卸载应用程序


仅清理和重建不起作用,我必须首先从设备上卸载应用程序。…

解决方案是从测试设备上手动卸载应用程序


仅清理和重建不起作用,我必须首先从设备上卸载该应用程序….

该类不符合您的要求。apk,请清理和重建,或者您需要重新启动Visual studio。有趣的是,将此标记为重复,而问题指出它不超过64k限制。最后,它与multi-dex无关,因为它已启用。该类不符合您的.apk要求,请清理并重建,或者您需要重新启动Visual studio。有趣的是,将其标记为重复,而问题指出它未超过64k限制。最后,它与multi-dex无关,因为它已经启用了