Common compilations problems in Xamarin and how to solve it

While using Xamarin, I have experienced a wide variety of issues, ranging from simple, to very difficult. Which sometimes can drive me crazy.

These are the most common problems and how to solve it:

  1-Java.exe exited with code 1.

Solution:

1-Download the last version of ProGuard zip  https://sourceforge.net/projects/proguard/files/

2-UnZip the file and copy the folder content in the route where your SDK is located (specifically in the folder tools/proguard), for example:

Windows: C:\Users\Me\AppData\Local\Android\android-sdk\tools\proguard

Mac: /Users/Me/Library/Developer/Xamarin/android-sdk-mac_x86

 

 

If you would like to know where the root of your SDK is located, click in Preferences in your Xamarin project, and copy the URL shown in the SDK option

3-Replace the actual folder content with the content inside the Proguard folder. Make sure to keep these configuration files there:

4-Close your solution, open it again, clean and rebuild. 

 2-When running the app, it opens and immediately close  

Solution:

Go to your project options, and disable Fast deployment

3-Xamarin support package error

Please install package: ‘Xamarin.Android.Support.Design’ available in SDK installer. Please install package: ‘Xamarin.Android ….

Solution:

Go to this root:

  • Mac: ~/.local/share/Xamarin/    
  • Windows:  C:\Users\Me\AppData\Local\Xamarin\

Delete all the files there and then go to your project and click on rebuild all.

4-Some missing dependency of a package in the project but you see the reference there

Solution:

Go to the package folder, delete the package, then go to the project and click on Restore.

5-Project does not want to debug in Android

Solution:

In your Android project, do right click in the solution and click in options.

There make you sure you have “Use Shred Mono Runtime” checked.

6-Error: Fody: An unhandled exception occurred

Solution:

Clean the project before attempting the build.

7- Architecture is not supported

Solution:

In your Android project, do right click in the solution and click in options. There select the Architecture you want to support:

More information about it: https://developer.xamarin.com/guides/android/application_fundamentals/cpu_architectures/

These are the most common problems that have happened to me, some extra recommendations in case you have another different issue and you don’t know how to solve, could be: 

1-Go to your project folder and delete the Bin/Obj folders.

2-Close your Xamarin Studio and Open it again.

3-Make sure your Xamarin Studio/ Visual Studio is up to date, if not update it.

4-If none of the above works restart your computer (Believe that works sometimes).

Hope that helps someone! :). Happy coding! 

You may also like