Issue in release mode upgrading minSdkVersion from 21 to 23
- Dominant language
- Kotlin
- Stars
- 7.8k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
- [x] I have searched [existing issues](https://github.com/facebook/litho/issues) and this is not a duplicate
## Version
```groovy
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**
```groovy
...
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.
Contributor guide
Assessment
This issue has not been assessed yet.