run-android 되지 않을 때 / Could not compile settings file /JDK 문제
- 에러1
react-native run-android
디바이스 연결도 잘 되어있는데 안됐다. (참고로 예전 맥북에서 새 맥북으로 바꿔서 안드로이드 실행 처음 해보는거였음)
에러 뜸
* What went wrong:
Could not compile settings file '/Users/daheeahn/Desktop/DaheeSpace/roubit_app/android/settings.gradle'.
> startup failed:
General error during semantic analysis: Unsupported class file major version 57
jdk 13을 깔아서 생겼던 문제.
이곳에서 jdk 8을 깔자
https://igeniusdo.tistory.com/11
맥(MAC) - 자바(JAVA) 8 설치
맥에서 자바 설치 과정을 간단히 알아 보자. 먼저 터미널에서 자바가 설치 되었는지 확인해 보자. 명령어 : java -version (아래는 터미널에서 자바 설치를 확인해 본 모습) 설치가 되어 있지 않으니 설치를 하러..
igeniusdo.tistory.com
오라클 계정 가입하고
deg9810@gmail.com
ㄷㅈ09A!
전에 깔았던 jdk 13은 삭제하기!
- 에러2
* What went wrong:
A problem occurred configuring project ':app'.
> 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
sdk 위치를 못찾아서 생기는 문제.
터미널 켜서 .bash_profile 열기
vi ~/.bash_profile
이 파일이 없다면 새 파일이 생성되고, 아니면 원래 있던 파일이 열릴거임!
[Mac] adb path 설정하기 - Blog Goooood.net
adb path 설정 test path가 서정되어있지 않은 경우 adb명령어를 실행하면 오류 발생 $adb -version -bash: adb: command not found adb path 설정 방법 홈 디렉토리로 이동 cd ~ bash 쉘에서 사용자의 환경설정을 저장하는 .bash_profile 파일이 있는지 체크 ls -l -a .bash_profile .bash_profile이 없다면 새로 생성 touch -c .bash_profile .bash
blog.devez.net
참고) 이전에 여기 참고해서 adb 명령어도 사용 가능하게 했음 그래서 이미 저 파일이 있었음.
이 내용 .bash_file에 입력!
export ANDROID_HOME=/{Your Path go to Android SDK}/Android/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Your Path go to Android SDK 이곳에는 path를 알맞게 써주면 된다. 나같은 경우는
Users/library 로 써줬다.
그리고 적용
source ~/.bash_profile
참고) source 명령어는 스크립트 파일을 수정한 후에 수정된 값을 바로 적용하기 위해 사용하는 명령어이다.
다시 run
react-native run-android
성공!
- 에러3
(다른 프로젝트에서 생긴 에러)
> 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_HOME이라 그런가? 바로 위 에러에서 명ㅇ시해준 ANDROID_SDK_ROOT로 만들어주자.
export ANDROID_SDK_ROOT=/Users/daheeahn/library/Adroid/sdk/
그래도 안되니 android/local.properties 파일을 만들어주고 다음 라인을 입력하자.
sdk.dir = /Users/{USER_NAME}/Library/Android/sdk
(USER_NAME에는 daheeahn처럼 자신의 루트네임으로 변경)
정상 작동!
[출처]
https://github.com/gradle/gradle/issues/8570
Could not compile settings file 'F:\myRNproject\android\settings.gradle'. · Issue #8570 · gradle/gradle
problems as follows: FAILURE: Build failed with an exception. Where: Settings file 'F:\myRNproject\android\settings.gradle' line: 3 What went wrong: Could not compile settings file 'F:\...
github.com
[React Native] Run react-native got error “SDK Location not found”
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project’s…
medium.com
https://namocom.tistory.com/705
[macOS] JDK 삭제하기
설치는 패키지 파일을 이용하면 되는데 삭제는 언인스톨러가 없다. 지우는 방법은 /Library/Java/JavaVirtualMachines 로 우선 이동한다. ls 명령으로 목록을 보면, 3개가 보인다. (최근에 JDK 11을 설치했다.) cd..
namocom.tistory.com
https://klero.tistory.com/entry/source-명령어란
source 명령어란
리눅스에서 source 명령어란 무엇일까? - source 명령어는 스크립트 파일을 수정한 후에 수정된 값을 바로 적용하기 위해 사용하는 명령어이다. 예륻들어 /etc/bashrc 파일을 수정 후 저장하여도 수정한 내용이 바..
klero.tistory.com
React Native android build failed. SDK location not found
I have error when i start running android What went wrong: A problem occurred evaluating project ':app'. > SDK location not found. Define location with sdk.dir in the local.properties file or...
stackoverflow.com
'Solve Problem > Troubleshooting' 카테고리의 다른 글
앱 종료 시 푸시 알림 클릭했을 때 초기 렌더링이 2번 발생하는 문제 (0) | 2020.06.15 |
---|---|
@react-navigation/routers/src/index.tsx: Unexpected token (9:12) 해결법 (0) | 2020.05.20 |
[React Native] build가 영원히 되지 않을 때 (2) | 2020.05.10 |
[React Native] 에러 모음 (2) | 2020.03.28 |
local notification 안드로이드 알람이 멈추지 않을 때 (react-native-push-notification) (0) | 2020.03.05 |