반응형
플러터로 개발할 때 빌드 시 아래와 같은 에러를 만난다고 하면.....
- java 11 버전 이상 사용하라는 말이다!!
FAILURE: Build failed with an exception.
* Where:
Build file '[프로젝트 디렉토리]\android\app\build.gradle' line: 24
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────┐
│ [!] You need Java 11 or higher to build your app with this version of Gradle. │
│ │
│ To get Java 11, update to the latest version of Android Studio on │
│ https://developer.android.com/studio/install. │
│ │
│ To check the Java version used by Flutter, run `flutter doctor -v`. │
└───────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
어떻게 하라고 친절하게 알려준다.
그런데 저 gradle.properties 이 어디 있냐고????!!!
그거슨 바로 여기~~~
- [프로젝트 디렉토리]/android/gradle.properties
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
org.gradle.java.home=[JAVA 설치 디렉토리. ex) C:\\Program Files\\Java\\jdk-11]
그런데 말입니다~~~
난 이미 자바 11 버전을 쓰고 있는데 왜 이런 에러가 발생하는지... 참... --;;;
C:\Users\home>java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
반응형
'프로그래밍 > 플러터 Flutter' 카테고리의 다른 글
[플러터] 21. D-Day 앱 만들기 (0) | 2023.05.15 |
---|---|
[플러터] 20. setState() 상태 관리 (0) | 2023.05.12 |
[플러터] 18. 전자 액자 앱 만들기 (1) | 2023.05.10 |
[플러터] 17. 위젯의 생명주기(Life Cycle) (0) | 2023.05.08 |
[플러터] 16. 웹 앱 만들기 (2/2) - 구현 (0) | 2023.05.05 |