[TIL] React Native 오류

HangKem·2022년 11월 3일
0

React Native

목록 보기
1/1
post-thumbnail
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

안드로이드 스튜디오 버추얼 디바이스가 실행되지 않아서 생긴 문제.

안드로이드 스튜디오에서
Tools > AVD Manager 메뉴로 들어가면 Andriod Virtual Device Manager 창이 열리고
여기서 디바이스를 더블클릭하여 버츄어 디바이스 실행 후 명령어를 실행하면 정상 작동된다.
XCode로 실행될줄 알았는데 안드로이드는 AVD에서 열어줘야 되는 듯 하다.

> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.

현재 Gradle 플러그인을 실행하려면 Java 11버전이 필요하지만, 1.8 버전을 사용하고 있어서 발생되는 에러이다. Java를 재설치 해주고 터미널에서 ./gradlew clean 명령어를 실행하니 오류가 해결되었다.

SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '~/android/local.properties'.

SDK 경로를 찾을 수 없어서 발생하는 에러이다. 프로젝트 내 android 폴더에 local.properties 파일을 생성하고 sdk.dir=/Users/사용자이름/Library/Android/sdk을 추가해주면 오류가 해결된다.

profile
Front-End Developer

0개의 댓글