I am using a .NET Standard Xamarin solution and when creating my own classes in the android part, they do not get included with the .apk
I am getting the following exception:
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]]
I have used https://github.com/google/android-classyshark to check:
Total method count: 27569
The md51d6...
folder is not in the APK, but when I check obj/Debug/android/bin/classes
the folder is in there
Using API Version:25
Built action: Compile
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();
}
}
Services/TestService.cs
namespace DriverApp.Droid.Services
{
class TestService : Service
{
public override IBinder OnBind(Intent intent)
{
throw new NotImplementedException();
}
}
}