jineecode
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. 본문
React native
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
지니코딩 2022. 7. 6. 17:35빌드 실패 이슈
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/niege/todoRN/android/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> 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`.
* 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.
해결 링크
https://github.com/facebook/react-native/issues/33416
How to fix the error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8." in React Native? · Iss
Description [admin@DF713 android % ./gradlew app:installDebug FAILURE: Build failed with an exception. Where: Build file '/Users/admin/Downloads/ritehauler-user/android/app/build.gradle' li...
github.com
mac 유저
1. JAVA 11 설치
brew tap homebrew/cask-versions
brew install --cask zulu11
2. zshrc 파일 진입
vi ~/.zshrc
3. 환경변수 수정
// .zshrc
# export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
-참조: #은 리눅스의 주석이다
4. 저장
// esc 후,
:wq
5. 반영
source ~/.zshrc
이래도 안 된다면 안드로이드 스튜디오 자체를 업그레이드 해야합니다.
안드로이드 스튜디오 업데이트 하기.
최신 기능을 적용하여 안드로이드 앱을 개발하기 위해서는 안드로이드 스튜디오를 최신으로 업데이트 해야합니다. 안드로이드 스튜디오에서 업데이트 하는 방법은 아래와 같습니다. 1.안드로
docko.tistory.com
자바 업그레이드 확인
java -version
해결
그래도 안 된다면 프로젝트 다시 만들어보시길 추천드립니다
'React native' 카테고리의 다른 글
FlatList 의 renderItem 에 타입 지정하기 (0) | 2022.05.27 |
---|---|
인증번호 timer (0) | 2022.05.25 |
react-native svg 사용하기 (0) | 2022.05.25 |
react-native 라이센스 고지하기 [react-native-oss-license] (0) | 2022.05.24 |
react-native android 배포 (0) | 2022.05.24 |
Comments