• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

안드로이드 에뮬레이터 에러...

23.09.29 11:24 작성 조회수 534

0

react-native run-android

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.

(node:18259) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

(Use node --trace-warnings ... to show where the warning was created)

Jetifier found 866 file(s) to forward-jetify. Using 12 workers...

info Starting JS server...

info Launching emulator...

info Successfully launched emulator.

info Installing the app...

FAILURE: Build failed with an exception.

* What went wrong:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

* 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 255ms

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.

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

FAILURE: Build failed with an exception.

* What went wrong:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

* 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 255ms

at checkExecSyncError (node:child_process:885:11)

at execFileSync (node:child_process:921:15)

at runOnAllDevices (/Users/heejinroh/Desktop/희진/react-native/my_first_app/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async Command.handleAction (/Users/heejinroh/Desktop/희진/react-native/my_first_app/node_modules/@react-native-community/cli/build/index.js:182:9)

답변 1

답변을 작성해보세요.

0

인프런 AI 인턴님의 프로필

인프런 AI 인턴

2023.09.30

안녕하세요, 인프런 AI 인턴이에요.

안드로이드 에뮬레이터에서 발생한 에러 메시지를 보면,
“Could not initialize class org.codehaus.groovy.reflection.ReflectionCache”와 같은 오류가 발생하고 있는 것으로 보입니다.

해당 오류는 프로젝트에 필요한 라이브러리나 환경 설정이 올바르게 이루어지지 않아 발생할 수 있습니다.

이런 경우 해결 방법을 찾기 위해 다음과 같은 절차를 시도해볼 수 있습니다.

  1. 프로젝트의 Gradle 버전을 확인해 보세요.
    프로젝트의 루트 디렉토리에 있는 build.gradle 파일에서 Gradle 버전을 확인합니다. 버전이 최신인지 확인하고, 최신 버전으로 업데이트해 보는 것도 한 가지 방법입니다.

  2. AndroidX 라이브러리로의 마이그레이션 확인
    위의 에러 메시지에서 “Running jetifier to migrate libraries to AndroidX”라는 문구가 보입니다. 이 부분에서 AndroidX 라이브러리로의 마이그레이션이 진행되고 있는 것으로 보입니다. 이런 경우에는 jetifier를 비활성화해 보는 것도 시도해 볼 수 있습니다. “–no-jetifier” 플래그를 사용하여 jetifier를 비활성화할 수 있습니다.

  3. 에뮬레이터 재시작
    가끔 에뮬레이터 자체의 문제일 수 있으므로, 에뮬레이터를 재시작해 보는 것도 해결 방법 중 하나입니다.

그 외에도 해당 에러 메시지에 대해 구글링을 통해 원인을 찾아보시거나, React Native 공식 문서나 다른 개발자 커뮤니티를 참고하여 해결 방법을 찾아볼 수도 있습니다.

더 많은 도움이 필요하시다면, 오류 메시지와 함께 구체적인 환경 설정 및 사용 중인 라이브러리에 대한 정보도 함께 제공해주시면 더 정확한 도움을 드릴 수 있습니다.

수고하세요!