빌드 시 오류 발생

JDK와 Gradle

JDK not Found

안드로이드로 스위칭 후 빌드 시 아래의 오류가 보인다면 JDK문제일 것이다.

다른 버전 설치하면서 헤메기 전에 (나는 헤맸지만) 우선 공식 문서를 살펴보도록 하자.

위 사진의 첫 번째 오류에서 바로 알 수 있게 해놨으면 좋겠지만.. 공식 문서를 봐야지 알 수 있는 상황이다.

3번째 표를 보면 나의 경우 Unity 2022.3.2f1이니 JDK version은 11을 다운받으면 되는 것이다.

https://docs.unity3d.com/2023.3/Documentation/Manual/android-sdksetup.html

 

Unity - Manual: Android environment setup

Getting started with Android Android environment setup To create a Unity application for Android, you first need to set up your Unity project to support Android. To support Android, a Unity project requires the following dependencies: The Android Build Sup

docs.unity3d.com

그렇다면 JDK 11은 어디서 다운 받느냐 오라클에서 다운 받을 수 있다. (회원가입 필수)

회원가입 후 다운받도록 하자.

https://www.oracle.com/kr/java/technologies/javase/jdk11-archive-downloads.html

 

Java Archive Downloads - Java SE 11 | Oracle 대한민국

WARNING: These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production. For production use Oracle recommends downlo

www.oracle.com

 

설치하고 나서 체크 해제 후 'Edit - Preferences - External Tools - JDK - Browse - JDK 폴더'를 적용해주자

 

여차저차 했을 때 Gradle~~ 오류가 난다면?

JAVA의 환경변수 설정이 안 되어 있을 수 있다.

아래에 좋은 글이 있으니 따라서 적용해보자.

https://devparklibrary.tistory.com/28

 

[Unity] Android Resolver 사용 시 JAVA_HOME 설정 오류 해결 방법

Gradle failed to fetch dependencies. ... ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 오류 해결 방법. 유니티를 2019 이상 버전 사용 시 이전 버전의 유니티와는 다르게 JDK를 허브를 통해서

devparklibrary.tistory.com

 

 

SDK와 NDK

SDK not found

해당 폴더에 SDK가 없다고 한다. 바로 설치해주자.

SDK를 설치하기 위해 Android Studio를 사용한다.

https://developer.android.com/studio

 

Download Android Studio & App Tools - Android Developers

Android Studio provides app builders with an integrated development environment (IDE) optimized for Android apps. Download Android Studio today.

developer.android.com

설치가 다 됐으면 ... 버튼을 눌러 SDK Managager를 켜준다.

이제 다시 공식 문서를 볼 때다.

SDK Build tools는 32.0.0이고 SDK Command-line tools version은 6이다. (Unity 2022.3.2f1)

NDK는 r23b(23.1.7779620)을 설치해준다.

 

우측 하단의 Show Package Details를 체크해야 버전을 선택할 수 있다.

이 때 중요한 점은 '컴퓨터를 재시작해야한다'는 점이다. (이것 때문에 고생했음)

 

이러면 잘 될 것이다. (잘 되시길 바랍니다.)

manifest merger failed

이전에 gradle 문제를 해결 하고 다음 난관은 이녀석이었다.

manifest merger failed

이녀석은 그래도 쉽게 문제를 찾았는데 sdk 버전이 더 상위 버전이어야 한다는 것이다. 그래서 구글링을 좀 해보다가 Unity Forum에서 관련 정보를 찾게 되었다.

해결 방법

해결 방법은 이렇다.

Project Settings - Player - Other Settings에서 Minimum API Level을 조정하면 되는데

위의 사진에서 보다싶이 나의 경우는 24버전 이상을 다운받으라는 말이어서 안전하게 25버전을 다운 받았더니 성공적으로 빌드가 되었다.

Minimum API Level

 

Gradle build failed. See Console for details

안드로이드 빌드 중 이러한 오류가 떴다. 콘솔을 읽어보니 ~~ c:/문서 ~~ 로 중간에 한글 경로가 섞여있어서 나는 문제였다. 깃허브 기본 경로가 문서라서 자동으로 바뀔 줄 알았더만 아니었다니.. 나는 귀찮아서 그냥 c: 폴더에 넣었다.

경로 옮기기

해결!

+ Recent posts