Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

java.exe exited with code 2

JassimRahmaJassimRahma USMember ✭✭✭✭

Hi,

I am getting:

"java.exe" exited with code 2

after adding the AdMob Nugets

I enabled Multi-Dex but still getting the same error.

I have also added:

android:name="android.support.multidex.MultiDexApplication"

In my AndroidManifest.xml

The details log as per the attached shows:

com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded

How can I fix this please?

Thanks,
Jassim

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    You could try the following steps first:
    1. Close Project
    2. Delete bin and obj folders from PCL/Shared Project and all other platforms including Android
    3. Open project
    4. Rebuild

    If the error still exist, you can try to create a new project and copy the old project's code, resources, and packages to the new one.

  • JassimRahmaJassimRahma USMember ✭✭✭✭
    I did all this already and it did not work so I had to get rid of the firebase ads packages temporary and will try it later..

    Removing the firebase ads packages fixed the problems
  • Isha_DawarIsha_Dawar INMember ✭✭
    edited May 2019

    @JassimRahma Try enabling Multi-Dex option under project Settings without removing firebase packages.

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    It was enabled.

  • VovaKamishnikovVovaKamishnikov USMember ✭✭✭
    edited May 2019

    I had that issue when I don't install a nuget in ALL project but only in some of them.
    Do you install any new nuget in the solution?

  • VovaKamishnikovVovaKamishnikov USMember ✭✭✭

    @JassimRahma said:
    It was enabled.

    It seems like dex isn't enbaled :
    com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded

  • JassimRahmaJassimRahma USMember ✭✭✭✭

    Again I am having it but this now I didn't do anything nor new updates. It just occurs :'(

    I am unable to figure out where is the issue.

    I posted here with the log and screenshots to avoid multiple same post:

    https://forums.xamarin.com/discussion/comment/374407#Comment_374407

Sign In or Register to comment.