react native 0.76.2 on windows

반응형

 

git clone

 

nodejs lts

 

관리자 모드 nodejs command

 

corepack enable

프로젝트 디렉토리 가서 yarn set version berry

 

yarn

 

gradle.properties

org.gradle.java.home=C:\\Users\\i5\\AppData\\Local\\Programs\\Android Studio\\jbr

 

 

JAVA_HOME

C:\Users\i5\AppData\Local\Programs\Android Studio\jbr

 

 

C:\Users\i5\IdeaProjects\MyProject\mobile\myproject\node_modules\react-native\ReactAndroid\cmake-utils

 

fix build failure on windows in android by FouadMagdy01 · Pull Request #47641 · facebook/react-native

 

fix build failure on windows in android by FouadMagdy01 · Pull Request #47641 · facebook/react-native

Summary: This pull request addresses a CMake configuration issue where an invalid escape character in file paths caused the build process to fail. Specifically, it resolves the issue in the React ...

github.com

 


set(BUILD_DIR ${PROJECT_BUILD_DIR})
if(CMAKE_HOST_WIN32)
        string(REPLACE "\\" "/" BUILD_DIR ${BUILD_DIR})
        string(REPLACE "\\" "/" REACT_ANDROID_DIR ${REACT_ANDROID_DIR})
endif()

file(GLOB input_SRC CONFIGURE_DEPENDS
        ${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp
        ${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)

# Ensure that `input_SRC` paths use forward slashes
foreach(path IN LISTS input_SRC)
    string(REPLACE "\\" "/" path "${path}")
endforeach()

add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})

 

반응형

댓글

Designed by JB FACTORY