facebook / litho

A declarative framework for building efficient UIs on Android.
https://fblitho.com
Apache License 2.0
7.71k stars 764 forks source link

Issue in release mode upgrading minSdkVersion from 21 to 23 #727

Open tpucci opened 4 years ago

tpucci commented 4 years ago

Version

    versions = [
            litho                             : "0.39.0"
...
    dependencies = [
            litho_annotation_processor          : "com.facebook.litho:litho-processor:${versions.litho}",
            litho_core                          : "com.facebook.litho:litho-core:${versions.litho}",
            litho_fresco                        : "com.facebook.litho:litho-fresco:${versions.litho}",
            litho_sections_annotations          : "com.facebook.litho:litho-sections-annotations:${versions.litho}",
            litho_sections_annotations_processor: "com.facebook.litho:litho-sections-processor:${versions.litho}",
            litho_sections_core                 : "com.facebook.litho:litho-sections-core:${versions.litho}",
            litho_sections_widget               : "com.facebook.litho:litho-sections-widget:${versions.litho}",
            litho_widget                        : "com.facebook.litho:litho-widget:${versions.litho}",

✅ Proguard is OFF

...
        release {
            minifyEnabled false
            shrinkResources false

Issues and Steps to Reproduce

Crash:

error java.lang.ClassNotFoundException: com.facebook.jni.HybridData$Destructor
...
java.lang.NoClassDefFoundError: com.facebook.yoga.YogaNative
    at com.facebook.yoga.YogaNative.jni_YGConfigFree(Native Method)
    at com.facebook.yoga.YogaConfig.finalize(Unknown Source:2)
...

Expected Behavior

No crash.

Workaround

This issue seems related to #625 Adding implementation 'com.facebook.fbjni:fbjni:0.0.2' fixes this issue. However, I don't understand why changing minSdkVersion from 21 to 23 breaks things.

sherrif10 commented 3 years ago

Have you tried upgrading to 22 of miniSdkVersion