Skip to content

Commit

Permalink
fix: android build for react native 0.69
Browse files Browse the repository at this point in the history
  • Loading branch information
kantorm committed Jul 1, 2022
1 parent 147b911 commit 3b926d7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
22 changes: 16 additions & 6 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,22 @@ find_library(
PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH
)
find_library(
FOLLY_JSON_LIB
folly_json
PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH
)

if(${REACT_NATIVE_VERSION} LESS 69)
find_library(
FOLLY_JSON_LIB
folly_json
PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH
)
else()
find_library(
FOLLY_JSON_LIB
folly_runtime
PATHS ${LIBRN_DIR}
NO_CMAKE_FIND_ROOT_PATH
)
endif()

find_library(
REACT_NATIVE_JNI_LIB
Expand Down
13 changes: 11 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,14 @@ dependencies {
//noinspection GradleDynamicVersion
extractJNI("com.facebook.fbjni:fbjni:+")

def rnAAR = fileTree("${nodeModules}/react-native/android").matching({ it.include "**/**/*.aar" }).singleFile
def buildType = "debug"
tasks.all({ task ->
if (task.name == "buildCMakeRelease") {
buildType = "release"
}
})
def rnAarMatcher = "**/react-native/**/*${buildType}.aar"
def rnAAR = fileTree("$reactNative/android").matching({ it.include rnAarMatcher }).singleFile
def jscAAR = fileTree("${nodeModules}/jsc-android/dist/org/webkit/android-jsc").matching({ it.include "**/**/*.aar" }).singleFile

def inputFile = file("${nodeModules}/react-native/package.json")
Expand Down Expand Up @@ -285,7 +292,9 @@ if (ENABLE_FRAME_PROCESSORS) {
}

task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
src("https://github.com/react-native-community/boost-for-react-native/releases/download/v${BOOST_VERSION.replace("_", ".")}-0/boost_${BOOST_VERSION}.tar.gz")
def transformedVersion = BOOST_VERSION.replace("_", ".")
def srcUrl = "https://boostorg.jfrog.io/artifactory/main/release/${transformedVersion}/source/boost_${BOOST_VERSION}.tar.gz"
src(srcUrl)
onlyIfNewer(true)
overwrite(false)
dest(boost_file)
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ PODS:
- React
- RNVectorIcons (8.1.0):
- React-Core
- VisionCamera (2.13.3):
- VisionCamera (2.13.5):
- React
- React-callinvoker
- React-Core
Expand Down

0 comments on commit 3b926d7

Please sign in to comment.