본문 바로가기
Unity

[ARCore] Unity(2019.3 ~ 2019.4) Gradle 해결

by kldaji 2021. 7. 16.

https://developers.google.com/ar/develop/unity/android-11-build

 

Unity로 Android 11 용으로 빌드  |  ARCore  |  Google Developers

Android 11 (API 레벨 30)을 지원하기 위해 AR Foundation 용 ARCore 확장 및 Unity 용 ARCore SDK (1.19 이상)에 패키지 가시성 요소가 추가되었습니다. Unity 2018.4 이상에서 이러한 버전의 ARCore를 사용하는 경우 요

developers.google.com

 

※ 위의 문서에 설명이 잘 되어있지만 조금 더 사용자 편의에 맞춰 설명하고자 작성한 글이다.

 

1. https://gradle.org/releases/ 해당 링크에 접속해서 gradle 5.6.4 (2021.07.16 기준) 이상 버전을 complete로 다운로드를 받아준다. (이 때, 압축을 풀어주어야 하며, 시간이 꽤 걸린다...)

 

2. 압축을 풀어주면, gradle-5.6.4-all 이라는 폴더에 들어가고, 다시 한번 gradle-5.6.4 폴더에 들어간 후 해당 경로를 복사해준다.

 

3. 복사한 경로를 Edit > Preference > External Tools > Gradle에 복사해준다.

 

4. File > Build Settings > Player Settings > Player > Publishing Settings > Build > Custom Main Gradle Template을 체크하고, Custom Launcher Gradle Template를 체크해준다.

 

5. Assets 파일을 확인해보면 Plugins라는 폴더를 보게 될 것이다.

 

6. Plugins > Android에 들어가서 오른쪽 마우스 클릭 후 Show in Explorer을 한다.

 

7. 그러면 폴더 하나가 뜨는데 launcherTemplate.gradle 파일과 mainTemplate.gradle파일을 메모장을 통해 열거나, visual code와 같은 코드 편집기를 통해 열어준다.

 

8. 해당 주석 제거

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

9. 해당 코드 맨 위에 추가

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        // Must be Android Gradle Plugin 3.6.0 or later. For a list of
        // compatible Gradle versions refer to:
        // https://developer.android.com/studio/releases/gradle-plugin
        classpath 'com.android.tools.build:gradle:3.6.0'
    }
}

allprojects {
   repositories {
      google()
      jcenter()
      flatDir {
        dirs 'libs'
      }
   }
}

'Unity' 카테고리의 다른 글

[Vuforia] Add Traget Image Condition 충족시키는법  (0) 2021.07.15
Google VR SDK - Android  (0) 2021.07.14
[Animator] 애니메이션  (0) 2021.07.14
[CharacterController] 캐릭터 이동  (0) 2021.07.13
물체 충돌  (0) 2021.07.13