2

If I try to instantiate a .NET class derived from Java.Lang.Object, a ClassNotFoundException is thrown. This is easy to reproduce in a most basic project: create a new Android app using the Single-View App template, and add something like this:

public class Test1
{
}

public class Test2 : Java.Lang.Object
{
}

Then in the activity constructor:

var t1 = new Test1();
var t2 = new Test2();

The first line succeeds, the second line throws the exception. This happens both in the emulator and on the real device.

What am I missing? I'm using VS2017 and API 25 in case it's relevant. It seems like what I'm doing here must be a basic mistake, yet I couldn't find anything in Google on this particular issue.

Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
  • 1
    You aren't missing anything, This is a known issue: https://developer.xamarin.com/releases/android/xamarin.android_8/xamarin.android_8.1/#Known_Issues – Jon Douglas Dec 23 '17 at 03:42
  • If you can attach your reproduction to this question, it would help us track this issue down further. We have a reproduction, but it's a bit complex. – Jon Douglas Dec 23 '17 at 03:48
  • @JonDouglas attached to [bug 61073](https://bugzilla.xamarin.com/show_bug.cgi?id=61073). – Roman Starkov Dec 23 '17 at 05:06
  • Check if this isn't the same issue: https://stackoverflow.com/questions/47991044/xamarin-classnotfoundexception – Gustavo Gomes Dec 28 '17 at 11:17

0 Answers0