Skip to content

Commit

Permalink
New Architecture - Remove the extra steps required to copy .so files (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
cortinico committed Oct 16, 2022
1 parent ae47850 commit 20908b3
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions docs/new-architecture-app-intro.md
Expand Up @@ -193,9 +193,7 @@ dependencies {
- debugImplementation files(hermesPath + "hermes-debug.aar")
- releaseImplementation files(hermesPath + "hermes-release.aar")
+ //noinspection GradleDynamicVersion
+ implementation("com.facebook.react:hermes-engine:+") { // From node_modules
+ exclude group:'com.facebook.fbjni'
+ }
+ implementation("com.facebook.react:hermes-engine:+") // From node_modules
}
}

Expand Down Expand Up @@ -250,31 +248,6 @@ android {
}
```

In the same `build.gradle` file, inside the same `android{}` also add the following section:

```groovy
android {
// ...
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
def packageReactNdkLibs = tasks.register("packageReactNdkLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkLibsForBuck")
dependsOn("generateCodegenArtifactsFromSchema")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
afterEvaluate {
preBuild.dependsOn(packageReactNdkLibs)
}
packagingOptions {
pickFirst '**/libhermes.so'
pickFirst '**/libjsc.so'
}
}
```

Finally, you need to create two files that are required to build the native code correctly:

- A CMake file with the compilation instructions (similar to a `build.gradle` for Android/Java)
Expand Down

0 comments on commit 20908b3

Please sign in to comment.