• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

build.gradle 에 react.gradle 없는 문제

23.01.25 16:09 작성 23.01.25 16:19 수정 조회수 1.49k

0

안녕하세요~

최초 npx react-native init 프로젝트명 커맨드로 프로젝트를 만들면 build.gradle 파일에는 아래의 react.gradle 이 존재하지 않습니다.

apply from: "../../node_modules/react-native/react.gradle"

이부분은 향후에도 지원하지 않고 deprecated 된다고 하네요.

그래서 https://github.com/facebook/react-native/blob/main/template/android/app/build.gradle 여기 공식 github 에도 나와있지만 이제부턴 apply plugin: "com.facebook.react" 를 쓴다고 하고 프로젝트 init하면 default도 그렇게 되어 있습니다.

 

그런데 문제는!
이러한 build.gradle 환경에서 android 빌드해보면 아래와 같은 에러가 발생합니다.
bundleDebugJsAndAssets 를 :app 에서 찾을 수 없다고 나오는데 어떻게 해결하면 될까요?

 

info Starting JS server...

info Installing the app...

5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:

Could not determine the dependencies of task ':app:generateBundledResourcesHashDebug'.

> Task with path 'bundleDebugJsAndAssets' not found in project ':app'.

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:

Could not determine the dependencies of task ':app:generateBundledResourcesHashDebug'.

> Task with path 'bundleDebugJsAndAssets' not found in project ':app'.

 

아래와 같은 이슈인거 같은데 known 이슈로 지금 디버깅 중인걸까요?

https://github.com/microsoft/react-native-code-push/issues/2418

 

 

답변 1

답변을 작성해보세요.

0

코드푸쉬 설치 후에 발생하는 에러인가요? 그렇다면 맞는 것 같습니다. Rn 버전을 71버전으로 하신 경우에 발생하는 것 같습니다.