Android app crash NoClassDefFoundError on Samsung Lollipop devices

后端 未结 1 1964
攒了一身酷
攒了一身酷 2020-12-21 01:31

We recently bumped the minSdkVersion of our app from 16 (Jellybean) to 21 (Lollipop). Although we did extensive testing with our app predominantly using debug builds, we are

相关标签:
1条回答
  • 2020-12-21 02:02

    The fix for this was to disable pre-dexing:

    dexOptions {
        preDexLibraries false
    }
    

    in the app build.gradle. Inspiration for this came from this link regarding a Picasso class not found error on Lollipop: see here

    Its not entirely clear to me why disabling pre-dexing solves the problem, but I can only theorize that there is some optimization going on with the build process that affects the way classes are ordered in the dex files of the apk that then affects the app installation on these Samsung Lollipop devices. In theory ART should take care of all of that, but clearly there is a dependency between pre-dex optimization and some Lollipop devices.

    0 讨论(0)
提交回复
热议问题