1

I'm developing an Android App with Xamarin using Visual Studio 7.3.2 (build 12) for Mac (based on Mono), thus not using the real thing in Windows. Debugging is very, very inconsistent.

One of the common errors that gets thrown 1 out of 10 times is:

Java.Lang.NoClassDefFoundError has been thrown:

Failed resolution of: Luk/co/chrisjenx/calligraphy/R$attr;

Which I have in my base Activity's AttachBaseContext method:

    protected override void AttachBaseContext(Context @base)
    {
        base.AttachBaseContext(CalligraphyContextWrapper.Wrap(@base));
    }

If I stop and re-run, it eventually goes away. I was led to believe that this is because in the background, VS updates packages in the background and it's probably updating the calligraphy package? Is this the case? Why does it come up every once in awhile and is there a way I can permanently get rid of this?

Android manifest has minimum SDK at 24 and target at 26. Project -> Active Configuration is set to Debug. Multi-dex is enabled but I'm not explicitly including it in the Android manifest.

I have 3 emulators: Android Accelerated Nougat x86 API 25 Android 7.1.1, Android ARMv7a Nougat arm API 25 Android 7.1.1, and Nexus 5X x86 API 25 Android 7.1.1 and it's pretty consistent jumping between them.

Additionally, and maybe this is related but I also get this as a common thing:

java.lang.IllegalStateException: AppCompat has already installed itself into the Window

Could this be related? Why do both issues come up very often but go away when I re-start debugging after a few times?

SushiHangover
  • 73,120
  • 10
  • 106
  • 165
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
  • Using Xamarin.Android 8.1.0.24? https://stackoverflow.com/questions/48039351/do-i-know-if-i-need-multi-dex-enabled-classnotfoundexception – SushiHangover Dec 31 '17 at 08:06
  • @SushiHangover - Visual Studio 7.3.2 and Xamarin.Android Version: 8.1.0.25 internally within that. I do have Multidex enabled. – meder omuraliev Dec 31 '17 at 08:11
  • Possible duplicate of [Do I know if I need Multi-Dex enabled? (ClassNotFoundException)](https://stackoverflow.com/questions/48039351/do-i-know-if-i-need-multi-dex-enabled-classnotfoundexception) – Jon Douglas Dec 31 '17 at 08:59
  • @JonDouglas - Is that answer mainly for Windows (I'm on Mac)? And is it referring to just clean/rebuilding your project? I can clean/rebuild 3-5 times and it doesn't go away - takes some time. It's a real hassle. – meder omuraliev Dec 31 '17 at 17:37
  • No, it occurs on both OS in which Windows seems to reproduce it more often. Does clearing your obj/bin manually "fix" this issue? – Jon Douglas Dec 31 '17 at 21:36

0 Answers0