Salir
  • Comunidad global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Bloqueada

Problems with multidexing in Air 25

Colaborador ,
Apr 12, 2017 Apr 12, 2017

Hi,

I left a comment on this ticket: Tracker​ , but it looks like it's maybe considered resolved now because nobody responded. Multidexing support is not working for us.

What we are seeing is that any classes moved to classes2.dex are not available at runtime ( listed using dexdump classes2.dex | grep 'Class descriptor' ). So for example an ANE referencing classes that get put in the secondary dexfile will crash the app with Fatal Exception: java.lang.NoClassDefFoundError.

Does anyone out there have an app that uses multidexing and doesn't have this issue?

TEMAS
Beta de Air
2.1K
Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Colaborador ,
Apr 12, 2017 Apr 12, 2017

Just an update:

I tried putting just the class referenced by the NoClassDefFoundError in the keepfile (no others) and it actually caused the build to only use one dexfile, which also took care of the crash. I don't know why or how this happened but I guess it will be fine for now.

I'm thinking you might want to tell people that starting with this version of AIR, rather than failing the build, if their app has >65k functions in it, AIR will quietly switch to multidex mode which means they'll have to add lines to that keep file to avoid crashing. You should probably also provide a way to disable multidex (or document it if one already exists). Since it seems like all classes in ANEs need to be in the main dexfile, why not have the packager handle that automatically? It's awkward that we have to modify a file in the AIR SDK directory to do this, and it's time-consuming to figure out which classes need to be included in it.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Empleado de Adobe ,
Apr 17, 2017 Apr 17, 2017

Hey,

Is it possible for you to share the project? We will be able to give you better suggestions after looking at the project.

We can't add all the ANEs to the main dex file in the package, as it might again cause the main dex file to cross the limit of 64k.

Thanks,

Rohit

Adobe AIR Team

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Colaborador ,
Apr 17, 2017 Apr 17, 2017

My post detailed the way I was able to solve our problem for the time being, and suggested that you guys provide more complete documentation of how to use this feature - for example, how to add classes from an ANE to the secondary dexfile and still have it work properly - as well as a way to disable it in the build if desired. Not quite sure how sending you our source code is related to those things, and in any case I can't, any more than you can send me the source code to the closed-source portions of AIR/Flash.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Nuevo aquí ,
Apr 19, 2017 Apr 19, 2017

Could it be that you are testing on a device with an Android version < 5.0 ?

We've made the experience, that it works fine on Android 5.0+, but not on older version.

It may have to do with with the fact that Android < 5.0 requires a support library to be able to run multidex builds (see https://developer.android.com/studio/build/multidex.html

(especially the paragraph "Multidex support prior to Android 5.0")

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Colaborador ,
Apr 19, 2017 Apr 19, 2017

Hm no this was with 5.1, although if this could break in other ways on android 4.x then it shouldn't be listed as supported in the system requirements. Like I said, adding the one class mentioned in the class-not-found error to the keepfile fixed it. But I don't know why, and I don't know what was wrong with that class being in the secondary file in the first place. It was totally trial and error. I'd rather have documentation about how to correctly use this feature, and the ability to disable it.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Comprometido ,
Jul 24, 2017 Jul 24, 2017

I think we finally have a solution to this multidex issue on Android < 5. It's actually turned out to be a lot simpler than we had first approached it and would appreciate if everyone could double check our findings.

Firstly make sure you are using AIR 25+ (recommend using 26).

Then change the manifest additions for the application tag to match the following and use the MultiDexApplication:

<manifest android:installLocation="auto">

    <!-- PERMISSIONS -->

    <application android:name="android.support.multidex.MultiDexApplication">

        <!-- ACTIVITIES / RECEIVERS / SERVICES -->

    </application>

</manifest>

air native extensions // https://airnativeextensions.com
Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Nuevo aquí ,
Mar 15, 2018 Mar 15, 2018
MÁS RECIENTES

A bit of a delayed reply...

I tried adding android:name="android.support.multidex.MultiDexApplication" to the application tag. This does indeed fix the problems we were having with Multidex builds on Android < 5. (I'm using AIR SDK 29 beta at the moment)

That is a great help! Thanks a lot!

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines