We should give a better error. when users encounter: Xamarin.Android.Common.targets(3,3): Error MSB6006: “java” exited with code 2.
typically caused by going over the dalvik method limit. Point them to a doc telling them to reduce dependencies or enable mutlidex
I believe this issue can be solved by resolving the following bug first:
Going back to external programs giving an exit code of 0-255, we should be returning an error to MSBuild's Error List that contains actionable steps for the user. Typically to find these actionable steps, the user has to enable diagnostic build output. Here's an example of dx.jar failing similar to what Clancey is reporting:
Thus the error message:
1> trouble writing output: Too many field references: 67288; max is 65536. (TaskId:260)
1> You may try using --multi-dex option. (TaskId:260)
Should be returned to the user to inform them on an actionable step. We could potentially reword this message to say "Enable Multidex in your Android Options" which they actually have control over.