locked
Google Play Services - Ads throws java.exe exited with code 2 RRS feed

  • Question

  • User187134 posted

    I tried to add this component today, but after adding it, I started to receive java.exe exited with code 2 exception.

    Is this a bug in the component or do I have to change something to make this work?

    Thank you in advance

    Friday, June 9, 2017 11:01 PM

Answers

  • User102046 posted

    @LarsNymand yes it happens, actually you hit the 64k method limit in java. for this please enable multidex option in the project properties or you can use ProGuard(it is a little bit complex). just google for multidex/java64k limit you will understand

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, June 10, 2017 9:13 AM

All replies

  • User102046 posted

    @LarsNymand yes it happens, actually you hit the 64k method limit in java. for this please enable multidex option in the project properties or you can use ProGuard(it is a little bit complex). just google for multidex/java64k limit you will understand

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, June 10, 2017 9:13 AM
  • User187134 posted

    Thank you @Xami3 I think I misunderstood the other threads. I thought this error only came if one of those were enabled.

    I enabled Multidex which game me the same error as in this thread: https://forums.xamarin.com/discussion/88955/upgraded-to-android-7-0-no-longer-builds

    After moving android-sdk to a folder without spaces and changed the sdk path in visual studio (tools -> options -> xamarin)

    now everything compiles but no ads were showing.

    I will have to investigate that some more.

    Saturday, June 10, 2017 7:53 PM
  • User102046 posted

    @LarsNymand yes after enabling multidex, if your path for android sdk contains spaces then it gives another error. in my case java2 error was because of googleplay services. i am using latest sdk. then i moved sdk to D drive with no spaces. i had to update proguard in the sdk folder too.

    Saturday, June 10, 2017 9:34 PM