android中引入yoga

新版的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" 

posted on 2020-04-24 23:56  barani  阅读(1229)  评论(0编辑  收藏  举报

导航