animo / react-native-bbs-signatures

React Native Wrapper around the ffi-bbs-signatures package using TurboModules.
Apache License 2.0
9 stars 5 forks source link

Build fail on android #78

Open ronickg opened 1 year ago

ronickg commented 1 year ago

FAILURE: Build failed with an exception.

BUILD FAILED in 3s

JJMoon commented 2 months ago

It's been almost a year since this issue started.

I am also digging to solve this issue. I solved this (line 159) issue, but there's another. So I share the solutions for this issue.

Add maven central. (optional)

    maven {
      mavenCentral() // You might need this..
      url "https://plugins.gradle.org/m2/"
    }

In dependency

dependencies {
  // noinspection GradleDynamicVersion
  implementation("com.facebook.react:react-android") // this is optional
  implementation 'com.facebook.react:react-native:+'

  implementation 'com.facebook.fbjni:fbjni:0.2.2' // Add this line

  // Comment out all those lines.
  //noinspection GradleDynamicVersion. 
  // extractHeaders("com.facebook.fbjni:fbjni:+:headers")
  //noinspection GradleDynamicVersion
  // extractJNI("com.facebook.fbjni:fbjni:+")

  // if (!sourceBuild) {
  //   def rnAAR = fileTree("${defaultDir.toString()}").matching({ it.include "**/**/*.aar" }).singleFile
  //   extractJNI(files(rnAAR))
  // }

And set the third party versions manually. The version numbers can be imported (refer to the cradle.build.kts file). So these are temporary.

def BOOST_VERSION = "1_86_0"

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")
  src("https://archives.boost.io/release/1.86.0/source/boost_1_86_0.tar.gz")
  onlyIfNewer(true)
  overwrite(false)
  dest(boost_file)
}

...

task downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Download) {
  src("https://github.com/google/double-conversion/archive/v1.1.6.tar.gz")

  // src("https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz")
  src("https://github.com/facebook/folly/releases/download/v2024.08.19.00/folly-v2024.08.19.00.tar.gz")

  // src("https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz")
  src("https://github.com/google/glog/archive/refs/tags/v0.7.1.tar.gz")

But, after this new error comes.

* What went wrong:
Execution failed for task ':animo-id_react-native-bbs-signatures:configureCMakeDebug[arm64-v8a]'.
> [CXX1306] /Volumes/.../node_modules/@animo-id/react-native-bbs-signatures/android/CMakeLists.txt debug|arm64-v8a : CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  JSI_LIB
      linked by target "reactnativebbssignatures" in directory /Volumes/.../node_modules/@animo-id/react-native-bbs-signatures/android
  REACT_NATIVE_JNI_LIB
      linked by target "reactnativebbssignatures" in directory /Volumes/.../node_modules/@animo-id/react-native-bbs-signatures/android