dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #43071
Re: [Android] Sdk method count
Hi Ignacio Foche,
Thanks for reply. So in my previous mail, I had said
> I try to set multidex but it's not stable, some feature not found class rx occur.
I had done similar like you (a lot results on google or stackoverflow). You can read full docs at http://developer.android.com/tools/building/multidex.html <http://developer.android.com/tools/building/multidex.html> and noticed Multidex support for Android 5.0 and higher and Avoiding the 65K Limit part.
With this you'll build success, but your apk higher, but if your project is injected some more lib using more annotation or not common declare (like reactiveX, dagger, retrolamda, ... ) it will not work stable, sometime will crash with no reference error. That why I'm not continue with that solution and try to review and do anything about reduce method.
Yours sincerely,
Nhan Cao
nhancv@xxxxxxxxxxx
> On Feb 7, 2016, at 5:20 PM, Ignacio Foche <nacho.foche@xxxxxxxxx> wrote:
>
> Hi Nhan Cao,
>
> in EyeSeeTea we're also integrating Crashlytics and the DHIS2 SDK in our projects, and we've experimented that problem, so here I tell you how we solved it.
>
> 1. Add to the dependencies of your project, in your gradle.build, the multidex library
> compile 'com.android.support:multidex:1.0.1'
>
> 2. Create, if your project doesn't have it now, an Application class that extend from Dhis2Application
>
> public class EyeSeeTeaApplication extends Dhis2Application {
> ..
> }
> (after that, whenever you tell Crashlytics to integrate with your problem, it will probably introduce its code inside the "onCreate()" method)
>
> 4. Import MultiDex in your Application class (EyeSeeTeaApplication in the example)
> import android.support.multidex.MultiDex;
> 5. Override in your Application class the attachBaseContext() method to make DBFlow work with MultiDex:
> /**
> * Function used to make DBFlow compatible with multidex
> * @param base
> */
> @Override
> protected void attachBaseContext(Context base) {
> super.attachBaseContext(base);
> MultiDex.install(this);
> }
>
> 5. Consequently, in your AndroidManifest.xml there would be something like...
> <application
> android:name=".EyeSeeTeaApplication"
> android:allowBackup="true"
> android:icon="@drawable/qualityapp_logo"
> android:label="@string/app_name"
> android:theme="@style/EyeSeeTheme"
> tools:replace="android:icon,android:theme" >
> ...
>
> this is...you have to declare your application in your AndroidManifest.xml.
>
> And I think that I didn't forget anything. I hope this can help you and anyone else with the same problems (enabling MultiDex in a project with DBFlow)
>
> Best regards
>
>
> 2016-02-06 13:09 GMT+01:00 Nhan Cao <nhancv@xxxxxxxxxxx <mailto:nhancv@xxxxxxxxxxx>>:
> Hi all,
>
> I have problems when I integrate fabric into my project. UNEXPECTED TOP-LEVEL EXCEPTION (the dex 65K method limit). I try to set multidex but it's not stable, some feature not found class rx occur. So I create new default app and include sdk for test method of sdk, it's bit number: 57894 method. I think it's problem for anyone want to extend it. Who can provide me a proguard file to reduce it. I has include file method count of sdk-2.22-legacy.
>
>
>
>
> Yours sincerely,
> Nhan Cao
> nhancv@xxxxxxxxxxx <mailto:nhancv@xxxxxxxxxxx>
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
>
>
>
> --
> ----
> Clave pública PGP:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E <http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8185416E>
Follow ups
References