Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
64K reference issue with Android Studio — Gideros Forum

64K reference issue with Android Studio

simwhisimwhi Member
edited June 2016 in General questions
Hi All,

Does anyone know how to resolve the 64K reference (dex) issue when creating APKs? I've implemented Appodeal, flurry, iab and facebook plugins in our game. However, they exceed the reference limit permittted.

Is it possibly to use multidex (split the app)? I did try it, but I got no where quickly. I also tried ProGuard, but I don't think Gideros supports it.

Alternatively, is anyone using a good ad mediation network?

Any advice would be much appreciated.

Comments

  • simwhisimwhi Member
    edited June 2016
    @keszegh I followed the instructions, but it did not work. I got errors in the debug build that I could not resolve.
  • As far as i remember appodeal supports flurry, so what's the point implementing flurry separately? I had a similar issue, but solved it with multidex and help of appodeal's support, i think that the simplest way is to contact their support, cause they usually respond within several hours unlike many others.
    btw to my experience appodeal is the best mediation i've tried for now (compared to heyzap, fyber and supersonic)
  • simwhisimwhi Member
    edited July 2016
    @QuentinX Thanks for the information. I didn't know that they also support analytics. I will try this out at some point.

    I contacted their support. The guy that helped me did not know anything about Gideros.
  • papirosnikpapirosnik Member
    edited July 2016
    You may just strip jar files
    (http ://stackoverflow.com/questions/4520822/is-there-a-quick-way-to-delete-a-file-from-a-jar-war-without-having-to-extract)
    and remove some excessive classes from there. For example, drivers, measurement, fitness and other similiar classes looks like good candidates to be excluded from google-play-services.jar. By this way it's possible to reduce method count drastically (from 64k to ~40k)
    I've never did this for gideros but for others cases did, and it worked perfectly. I'm pretty sure there won't be any problem for gideros too.
  • simwhisimwhi Member
    @papirosnik That's very Interesting. Many thanks
  • simwhisimwhi Member
    I've managed to find the solution to the 64K reference issue after digging around the Google API guides. I'm beginning to become an expert!!

    https://developers.google.com/android/guides/setup#split

    Rather than adding:

    compile 'com.google.android.gms:play-services:9.0.0'

    to the gradle build file, I just add the following:

    compile "com.google.android.gms:play-services-auth:9.2.0"
    compile "com.google.android.gms:play-services-base:9.2.0"
    compile "com.google.android.gms:play-services-identity:9.2.0"
    compile "com.google.android.gms:play-services-location:9.2.0"
    compile "com.google.android.gms:play-services-ads:9.2.0"
    compile "com.google.android.gms:play-services-places:9.2.0"
    compile "com.google.android.gms:play-services-games:9.2.0"
    ** compile "com.google.android.gms:play-services-safetynet:9.2.0"
    compile "com.google.android.gms:play-services-wallet:9.2.0"

    ** not sure if this is required. I haven't tested
    excluding google wear / maps etc.

    I hope this helps.
  • antixantix Member
    @simwhi in theory this could still cause issues later if you ever exceeded the limit again.. I smacked my head against this yesterday and made a solution that seems to be working..

    In gradle (module.app) you need 2 new entries, one in android{} and one in dependencies{}...
    android {
            multiDexEnabled true
    }
     
    dependencies {
        compile 'com.android.support:multidex:1.0.0'
    }
    In AndroidManifest.xml you need a new entry in the part..
        android:name="android.support.multidex.MultiDexApplication">
    I'm pretty sure that's all I needed to do to make MultiDex work. Let me know if you try :)

    Likes: totebo, simwhi

    +1 -1 (+2 / -0 )Share on Facebook
  • The 11th compiled .jar file tipped me over the edge. Thanks @antix, that worked! The multiDexEnabled had to go inside defaultConfig for me, like this:
    android {
        compileSdkVersion 21
        buildToolsVersion "21.1.0"
     
        defaultConfig {
            ...
            minSdkVersion 14
            targetSdkVersion 21
            ...
     
            // Enabling multidex support.
            multiDexEnabled true
        }
        ...
    }
     
    dependencies {
      compile 'com.android.support:multidex:1.0.0'
    }

    Likes: antix

    My Gideros games: www.totebo.com
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.