0

When I add the Xamarin.Firebase.Messaging library, my project generates an error that I am not able to solve, of the following error 'java.exe exited with code 2', what could be happening?

Image error:

enter image description here

pinedax
  • 9,246
  • 2
  • 23
  • 30
Sabino
  • 21
  • 9
  • 2
    Enable Diagnostic level logging for MSBuild and add the details of the error to your question (cut/paste the text for the error, please do not add images of text-based content) : https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#Diagnostic_MSBuild_Output – SushiHangover May 23 '17 at 22:38
  • 1
    You most likely need to move your Android SDK to a non-space path and ensure you apply https://stackoverflow.com/questions/39514518/xamarin-android-proguard-unsupported-class-version-number-52-0/39514706#39514706 as well. – Jon Douglas May 23 '17 at 23:20

1 Answers1

0

Adding Firebase in most applications will hit the 64k method limit in Java and thus require developers to use multi-dex.

A bug has been opened in Xamarin here: https://bugzilla.xamarin.com/show_bug.cgi?id=55117

To work around the issue you can enable multi-dex as shown in the following screenshot:

enter image description here

On release builds, you can also try combining Proguard and Link All options but it requires more work to avoid any side effect to find everything to preserve.

Guillaume Perrot
  • 4,278
  • 3
  • 27
  • 37