trouble writing output: Too many field references: 69636; max is 65536. (TaskId:320) 2

Hi , I am developing a cross platform app using Xamarin native app. While trying to add the Azure Messaging Component, I am getting error saying

-- trouble writing output: Too many field references: 69636; max is 65536. (TaskId:320)
2> You may try using --multi-dex option. (TaskId:320)

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2068,3): error MSB6006: "java.exe" exited with code 2.

if I am tying to enable the --multi-dex option in properties my app not deploying into the mobile.

Can any one please help me.

Tagged:

Posts

  • vyshnaviekshithavyshnaviekshitha USMember

    yes, im also facing same problem when i added more packages / components or references and then im unable to build my project its showing same error C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2068,3): error MSB6006: "java.exe" exited with code 2.
    "java.exe" exited with code 2." --- unable to solve this error did'nt find any solution
    can any one help me...?

  • PiotrZyskowskiPiotrZyskowski PLMember

    Confirm above.
    Spent few hours to make build pass... till I saw your post.

    In my case there wasn't AndroidEnableMultiDex option just that first option was. I just had to add it to csproj and voila:)

    It also gets work on Mobile Center and auto builds.

    Thanks.

  • JoeDluzenJoeDluzen USBeta ✭✭

    Can also confirm, this was the fix for me as well.

  • KiranMandavaKiranMandava INMember

    Thank u so much. My Issue is solved with your advice.

  • rdeveenrdeveen USMember
    edited June 2017

    When adding the second AndroidEnableMultiDex I get this extra error:

    error : Expecting class path separator ';' before '\Android\android-sdk\build-tools\25.0.2\lib\shrinkedAndroid.jar' in argument number 8

    But that looks like a VS2017 Preview bug :( but it work on VS2017.

  • pratik90pratik90 INMember ✭✭

    @diegoxleon Thanks, I also confirm that change is working and now can able to create build using vsts

  • DevologyDevology GBMember ✭✭
    edited February 15

    Setting the multi-dex option worked for me too, thanks. It's worth highlighting that you can set this for debug and release and in release you might not need to if you have used ProGuard (it might bring you under the limit anyway).

Sign In or Register to comment.