litho icon indicating copy to clipboard operation
litho copied to clipboard

Issue in release mode upgrading minSdkVersion from 21 to 23

Open tpucci opened this issue 4 years ago • 1 comments

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

  • Set minSdkVersion to 21.
  • In your code, mount a litho view.
  • Build and run in debug mode: OK ✅
  • Build and run in release mode: OK ✅
  • Upgrade minSdkVersion from 21 to 23.
  • Build and run in release mode: KO ❌.

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.

tpucci avatar Nov 19 '20 08:11 tpucci

Have you tried upgrading to 22 of miniSdkVersion

sherrif10 avatar Dec 06 '20 11:12 sherrif10