谁能告诉我如何手动链接


  反应本机复活


因为自动cli链接无法正常工作并导致本机应用崩溃

最佳答案

在Android中,将以下行添加到android / settings.gradle

include ':react-native-reanimated'project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')

将编译行添加到android / app / build.gradle中的依赖项

implementation project(':react-native-reanimated')

在MainApplication.java中导入并链接包

import com.swmansion.reanimated.ReanimatedPackage;

protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
         new ReanimatedPackage(), );// <-- add this line
}
}


在android / build.gradle中

ext {
compileSdkVersion           = 25
targetSdkVersion            = 25
buildToolsVersion           = "25.0.2"
googlePlayServicesVersion   = "12.0.1"
supportLibVersion           = "27.0.0"
 }

07-24 13:04