2

Can anyone please tell me how to manual link

react-native-reanimated

because the automatic cli linking not working and crashing react native app

Savad
  • 1,240
  • 3
  • 21
  • 50

1 Answers1

5

In Android,Add the following lines to android/settings.gradle

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

Add the compile line to the dependencies in android/app/build.gradle

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

the import and link the package in MainApplication.java

import com.swmansion.reanimated.ReanimatedPackage;

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

in android/build.gradle

ext {
compileSdkVersion           = 25
targetSdkVersion            = 25
buildToolsVersion           = "25.0.2"
googlePlayServicesVersion   = "12.0.1"
supportLibVersion           = "27.0.0"
 }
Aurangzaib Rana
  • 4,028
  • 1
  • 14
  • 23
  • Thanks for the replay...... But i got this error :-A problem occurred evaluating project ':react-native-reanimated'. > Cannot get property 'supportLibVersion' on extra properties extension as it does not exist – Savad May 30 '19 at 12:43
  • 1
    add this code in you android/build.gradle: `ext { compileSdkVersion = 25 targetSdkVersion = 25 buildToolsVersion = "25.0.2" googlePlayServicesVersion = "12.0.1" supportLibVersion = "27.0.0" }` – Aurangzaib Rana May 30 '19 at 16:55