Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on LoadApplication in Xamarin Forms PCL

I created a new Xamarin Forms PCL solution, and in debug mode I checked the Enable ProGuard option and I selected Linking comboxbox to Sdk and User Assemblies. Now I run my application on android, after that it shows me an error in MainActivity.cs class and on line

LoadApplication(new App());

Error:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.

I do that because of to decrease the size of my release app, and I have to change the release mode to debug in order to check what happened.

like image 895
Amir Hossein Khajegan Avatar asked Oct 29 '22 17:10

Amir Hossein Khajegan


1 Answers

As per: The type or namespace 'App' does not exist in the current namespace

Clean the solution Build the PCL Remove the PCL reference from the affected project(s) Re-add the PCL reference Build

I tried this solution and it works.

like image 188
Diomedes Avatar answered Nov 15 '22 04:11

Diomedes