How to fix the Xamarin.Forms android app instantly closing with error as ‘Unfortunately, [App name] has stopped’ after deployment

Xamarin.Forms android app instantly closing with error after deployment.

My application kept closing instantely after being deployed showing the following error:

“Unfortunately, [App name] has stopped.”

Fixing the issue

The problem was in the csproj file.

AndroidUseLatestPlatformSdk was set to true which was forcing the app to look for the latest sdk and the latest sdk I installed was 24! After setting it to false all went well again.

You can also set it from right click on project > Options > General > Target framework > Select your framework.

Conclusion

Remember to use adb logcat to check the issue and make sure you are targeting the correct version of Android. Hope this post was helpful for you! As usual if you have any comments leave it here