inflearn logo
강의

Course

Instructor

Practical React Native for iOS/Android App Development - Basic

VIsual studio code 에서 react-native run-android 실행시 오류

841

2kyuhang

2 asked

0

다음과 같이 오류가 나옵니다.

안드로이드 에뮬레이터는 실행되지만 APP.js에서 작성한 코드를 띄우려 시도 불가입니다.

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 4s

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.bat 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 4s

at checkExecSyncError (child_process.js:616:11)

at execFileSync (child_process.js:634:13)

at runOnAllDevices (C:\Users\82107\kkk\my_first_app\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)

at process._tickCallback (internal/process/next_tick.js:68:7)

react react-native es6

Answer 2

0

2kyuhang

윈도우입니다.

그리고 gradle를 최신버전으로 설치했는데 동일합니다 해결방법 부탁해요

0

communityai8509

안녕하세요, 인프런 AI 인턴입니다.

해당 오류는 org.codehaus.groovy.runtime.InvokerHelper 클래스를 초기화하는 과정에서 문제가 발생한 것으로 보입니다. 이 문제는 Groovy 버전의 충돌 또는 Gradle과 관련된 문제일 수 있습니다. 다음 단계를 따라 문제를 해결해보시길 권장합니다.

  1. 프로젝트의 gradle-wrapper.properties 파일에서 사용 중인 Gradle 버전을 확인하고 필요하다면 업데이트하세요.
  2. 로컬에 설치된 Gradle 버전이 올바른지 확인해보세요. Gradle 버전 확인 방법:
    
    $ gradle --version
    

  3. Groovy 버전의 충돌이 발생할 수 있으니, 시스템에 설치된 Groovy를 업데이트하거나 제거 후 다시 시도해보세요.
  4. Gradle의 종속성 캐시를 정리하려면, 프로젝트 디렉토리에서 다음 명령을 실행하세요:
    
    $ ./gradlew clean
    

  5. --stacktrace 옵션을 사용하여 더 상세한 스택 트레이스를 확인하세요:
    
    $ ./gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 --stacktrace
    

  6. 안드로이드 개발 환경 설정을 다시 점검하세요. React Native 공식 문서에서 안드로이드 개발 환경 설정에 대한 안내를 찾을 수 있습니다.

여전히 문제가 해결되지 않으면, Gradle과 관련된 더 많은 로그 정보를 볼 수 있도록 --info 또는 --debug 옵션을 추가하여 빌드를 실행해보세요.

참고: 안드로이드 개발 환경 구성에 도움이 필요하다면, React Native의 Android 개발 환경 설정 문서를 참조하시기 바랍니다.

0

2kyuhang

윈도우입니다.

그리고 gradle를 최신버전으로 설치했는데 동일합니다 해결방법 부탁해요

강의 자료 소스코드는 없나요?

0

319

1

RN 자동완성 기능 질문

0

307

1

환경변수 및 SOURCE관련 질문

0

286

1

글로벌로 설치한다는 게 무슨 말인가요? (-g)

0

311

1

리액트 네이티브에서 안드로이드 실행

0

557

1

vscode

0

404

2

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

0

962

1

웹뷰앱 만드는 자세한 방법이 궁금합니다.

0

422

0

App.js 화면 수정 시 안드로이드 emulator 오류

0

339

0

2

0

231

1

ios 구동했을 때 Welcome to React가 아니라 애플

0

470

1

1

0

203

0

진행중 막혀서 질문드립니다

0

374

0

drawer 파트

0

282

0

node.js 설치 오류

0

433

0

vs code 터미널에서의 command not found

0

1558

1

node js 10.15.1 설치가 안됩니다

0

303

0

Unable to boot device in current state: Booted 오류 발생하는경우

1

3182

0

adb 커맨드

1

525

1

Slider만 설치하면 애러가 납니다.

0

311

1

bounces 와 버튼 backgroundColor은 안드로이드에서 적용이 안되는건가요?

0

217

0

오류확인 부탁드립니다.

0

308

0

안드로이드 시뮬 작동 중 오류가 납니다.

0

234

0

iOS 시뮬레이터 오류

0

273

0