0

I upgraded to Xamarin.Forms 4.2. For Android, it crashed immediately after launch.

The error message is Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code).

After tracing through the code, the app has launched and there is no code left to execute. Then, it crashed.

Tek Mun
  • 97
  • 9
  • Make sure that the version of xamarin.forms in your android project is also up-to-date .You can delete the folder `bin` and `obj` in your share project and android project,then clean and rebuild it. – Lucas Zhang Sep 02 '19 at 07:52
  • You can try [this](https://stackoverflow.com/a/47901393/1663657) to get more information about error. – Renan Barbosa Sep 02 '19 at 09:28
  • I followed the instruction given by Renan. Here is my the relevant error message: `I/MonoDroid(13288): UNHANDLED EXCEPTION: I/MonoDroid(13288): System.NullReferenceException: Object reference not set to an instance of an object. I/MonoDroid(13288): at Xamarin.Forms.Platform.Android.AppCompat.Platform.op_Implicit (Xamarin.Forms.Platform.Android.AppCompat.Platform canvas) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:491` – Tek Mun Sep 02 '19 at 13:58
  • The same code works flawlessly in Xamarin.Forms 4.1. Is there any major changes in Android.AppCompat? – Tek Mun Sep 02 '19 at 14:03
  • It seems an existing issue , you can focus on it https://github.com/xamarin/Xamarin.Forms/issues/7301. – Lucas Zhang Sep 02 '19 at 14:34

1 Answers1

1

Thanks Lucas. As suggested, in SplashActivity.cs, change the class declaration to public class SplashActivity : global::Android.Support.V7.App.AppCompatActivity

Tek Mun
  • 97
  • 9
  • Had the same issue with a project, and was able to solved by changing from FormsAppCompatActivity to global::Android.Support.V7.App.AppCompatActivity too – Starlin González Sep 14 '19 at 20:24