新版的yoga直接在gradle中就可以导入了
gradle配置:
implementation ‘com.facebook.yoga.android:yoga-layout:1.16.0‘
implementation ‘com.facebook.soloader:soloader:0.9.0‘
implementation ‘com.facebook.fbjni:fbjni:0.0.2‘
SoLoader要先初始化:
SoLoader.init(this, false);
如下方法创建YogaNode:
new YogaNodeJNIFinalizer();
不引入fbjni会报如下错误:
SoLoader: couldn‘t find DSO to load: libyoga.so caused by: couldn‘t find DSO to load: libfb.so caused by: Didn‘t find class "com.facebook.jni.HybridData$Destructor"
原文:https://www.cnblogs.com/iguor/p/12771022.html