Notice
Recent Posts
Archives
Today
Total
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Recent Comments
관리 메뉴

우당탕탕 개발일지

[Unity] Build Error : unexpected element <property> found in <manifest><application> 본문

Unity

[Unity] Build Error : unexpected element <property> found in <manifest><application>

devchop 2023. 11. 8. 11:33

Unity version 23.3.20f 에서 빌드시 다음에러 발생

에러문은 다음과 같다.

* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\rapho\.gradle\caches\transforms-2\files-2.1\ed3a49a6baab5d780d3e657791554ea9\com.google.android.gms.play-services-measurement-api-21.5.0\AndroidManifest.xml:30:9-32:61: AAPT: error: unexpected element <property> found in <manifest><application>.
         

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:bundleReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\rapho\Documents\project-forwardWarrior\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build\intermediates\bundle_manifest\release\bundle-manifest\AndroidManifest.xml:275: AAPT: error: unexpected element <property> found in <manifest><application>.

 

Gradle 버전을 올려야 해결되는 문제라고 한다.

 

PlayerSettings > Publish Settings > custom base gradle template 활성화 후 baseProjectTemplate 파일을 오픈.

 

위 그림처럼 gradle버전은 4.2.1 로 변경

빌드를 수행하면 그래들 버전이 최소 6.7.1 이상 되어야한다는 메시지가 나온다. 따라서 따로 설치를 해주도록 한다.

 

https://gradle.org/releases/

 

Gradle | Releases

Find binaries and reference documentation for current and past versions of Gradle.

gradle.org

 

위 사이트에서 6.7.1 버전을 complete로 다운받은 후, 압축을 해제하여 원하는 위치에 넣어놓는다. 나의 경우 그냥 유니티 에디터쪽에 넣어줬다. 

C:\Users\rapho\Documents\2021.3.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools

 

Edit>Preference 에서 Gradle을 custom으로 변경 후 , 방금 설치했던 gradle-6.7.1 로 변경한다.

 

 

ForceResolve 후 빌드시 다음 에러 발생

What went wrong:
Execution failed for task ':launcher:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:
      - C:\Users\rapho\Documents\project-forwardWarrior\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar
      - C:\Users\rapho\Documents\project-forwardWarrior\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information

 

PlayerSettings > Publish Settings >  custom luancher template 을 활성화 한 후, launcherTemplate 파일을 오픈한다.

그 뒤 아래 구문을 추가한다. 

packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/ASL2.0'
            exclude 'META-INF/*.kotlin_module'
            exclude 'META-INF/kotlinx_coroutines_core.version'
        }

 

 

이런식으로 넣어주면된다. 

 

빌드가 성공적으로 된다!