Shopify / react-native-skia

High-performance React Native Graphics using Skia
https://shopify.github.io/react-native-skia
MIT License
6.98k stars 452 forks source link

CMake Error - Required Libraries Set to NOTFOUND #2719

Closed zaidqureshi95 closed 3 weeks ago

zaidqureshi95 commented 3 weeks ago

I’m encountering a CMake error when building react-native-skia. Several variables used in the project are not found, and they need to be set or verified in the CMake configuration files. This issue occurs when trying to compile for Android, and it seems to be related to dependencies in the @shopify/react-native-skia package.

Error Message:

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:
FBJNI_LIBRARY
  linked by target "rnskia" in directory ‘path/to/node_modules/@shopify/react-native-skia/android’
JSI_LIB
  linked by target "rnskia" in directory ‘path/to/node_modules/@shopify/react-native-skia/android’
REACT_LIB
  linked by target "rnskia" in directory ‘path/to/node_modules/@shopify/react-native-skia/android’
TURBOMODULES_LIB
  linked by target "rnskia" in directory ‘path/to/node_modules/@shopify/react-native-skia/android’

Version

1.5.0

Steps to reproduce

  1. Install react-native-skia in a React Native project.
  2. Configure the project to use the new architecture or make necessary adjustments to integrate react-native-skia.
  3. Attempt to build the project for Android using the Gradle build system.
  4. Encounter the error regarding the missing FBJNI_LIBRARY, JSI_LIB, REACT_LIB, and TURBOMODULES_LIB variables.

Additional Information:

Attempts to Resolve:

I have attempted the following, without success:

Expected Outcome:

Successful build of the project for Android without errors related to FBJNI_LIBRARY, JSI_LIB, REACT_LIB, and TURBOMODULES_LIB.

Request for Assistance:

Could you please advise on how to configure these dependencies correctly for Android builds? Alternatively, if this is an issue with the current version, please let us know if there is a fix or workaround.

Thank you!

Snack, code example, screenshot, or link to a repository

 defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
        targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
        versionCode 1
        versionName "1.0"
        buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

        externalNativeBuild {
            cmake {
                cppFlags "-fexceptions", "-frtti", "-std=c++1y", "-DONANDROID"
                abiFilters (*reactNativeArchitectures())
                arguments '-DANDROID_STL=c++_shared',
                          "-DREACT_NATIVE_VERSION=${REACT_NATIVE_VERSION}",
                          "-DNODE_MODULES_DIR=${nodeModules}",
                          "-DPREBUILT_DIR=${prebuiltDir}"

            }
        }
    }
wcandillon commented 3 weeks ago

My apologies for the confusion here, we only support RN 0.71 and above. I'm updating the documentation at #2720

github-actions[bot] commented 2 weeks ago

:tada: This issue has been resolved in version 1.5.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: