Multidexing response app ... crazy

I am trying to understand the madness that is the version of Android / multidexing / etc, because currently my application is broken.

So for various reasons, I decided to support only Android 5.0 (API 21 / LOLLIPOP ... argh! Why there are 3 names for this !?) and more. I know that there are many 4.x devices, but I decided that if this simplifies the problem, I have (5.0 was the first implementation of ART / dex2oat), then I am ready to ignore users up to 5.0. p>

All my questions relate to how to get the application to respond when deployed from the application store.

Currently, in my module/build.gradlefile, I have changed the default default settings:

android {

  compileSdkVersion 25
  buildToolsVersion "23.0.3"

  defaultConfig {
    applicationId "com..."
    minSdkVersion 21
    targetSdkVersion 25   

, . Proguard .

, , (-, ) 64- . , ? , APK, :

  • com.google.android.gms: ~ 18k
  • com.facebook: ~ 13k
  • android: ~ 34k

~ 65K! 1 ( ). 147 . ( ). , Android, , .

Q1: ? 4 , ~ 20 . ??? ?

Q2: multiDexEnabled true module/build.gradle ( dexOptions -> jumboMode -> true)... ?

, multidex , , , Im targeting API 21. compile 'com.android.support:multidex:1.0.1' , MultiDex.install(this); :

", minSdkVersion 21 , multidex"

(. https://developer.android.com/studio/build/multidex.html).

, Android 6, react-native run-android --variant=release, , . , , . .

, ... , 4 7 ( 7 v4.4 ):

Pixel   Android 7.1 English Native crash of /system/bin/dex2oat
Galaxy S6   Android 5.1 English java.lang.NoClassDefFoundError: Failed resolution of: Lcom/crashlytics/android/Crashlytics;

( ) . :

05-17 05:29:51.998: E/AndroidRuntime(12656): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.crashlytics.android.Crashlytics" on path: DexPathList[[zip file "/data/app/com.myappname-1/base.apk"],nativeLibraryDirectories=[/data/app/com.myappname-1/lib/arm, /vendor/lib, /system/lib]]
05-17 05:29:51.998: E/AndroidRuntime(12656):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

, crashlytics. , ( , ), , Google, (Pixel Android 7.1, Pixel Android O Galaxy S7 Edge Android 6.0), , ? ?

, APK 135 dex (135!? ?). dexdump, , ... :

`Class descriptor  : 'Lcom/crashlytics/android/Crashlytics;’`

Q3: ? .dex?

APK android 5.0, crashlytics.

- , .

( , Android ?)

+4

Source: https://habr.com/ru/post/1677359/


All Articles