[빌드에러/Android] java.lang.UnsupportedOperationException: This feature requires ASM7 (with GoogleMobileAds)
Untiy 2021.3.14f1
GoogleMobileAds 7.3.0
----
Unity 2021로 엔진 업데이트를 하고 빌드해보려는데 에러가 나서 보니 GoogleMobileAds 7.3.0 관련 이슈인 것 같다.
(GoogleMobileAds 7.2.0은 빌드 잘됨)
검색해보니 아래와 같은 해결책이 나온다.
- 간단히 말하면 Unity 2021에서 GoogleMobileAds 7.3.0을 쓰려면 gradle 버전 업데이트 하라고 한다. (아래 내용 따라하라고 함)
- 그래서 난 일단 GoogleMobileAds 7.2.0으로 버전을 내렸다(?)
--------------------------------------------------------------------------------------------------------------------------------
Yo so I found a way to solve this, assuming you are using applovin or charboost , what I did was:
- Delete resolved libraries : Assets> External Dependancy Manager > Android resolver > Delete resolve libs
- in player settings > pulishing settings uncheck all the one under build
- Download gradle 6.9
- Prefrences > external tools > uncheck gradle and browse to the installed gradle
- Assets> External Dependancy Manager > Android resolver > Force resolve
- then player settings > pulishing settings check all the ones you uncheck plus Custom Base Gradle Template
- edit the file Asstes\Plugins\Android\baseProjectTemplate.gradle
- change target api level to 31
- change the line that looks like classpath 'com.android.tools.build:gradle:yourversion' to classpath 'com.android.tools.build:gradle:4.2.0'
Build now it works. the funny thing is that gradle is 6.9 and com.adroid.tools.build:gradle: is 4.2.0 but it works.
[출처] https://www.reddit.com/r/Unity3D/comments/tktc13/i_need_help_asap/
--------------------------------------------------------------------------------------------------------------------------------
Hello. I solved my problem this way.
Download the latest Gradle version here.
https://gradle.org/releases/
Place the unzipped Gradle file in the following location
/Applications/Unity/Hub/Editor/2021.3.12f1/PlaybackEngines/AndroidPlayer/Tools/gradle/
Please note that 2021.3.12f1 is the editor version and should be replaced with your own environment.
Next, open Unity and change the Gradle to be used.
From the top menu, select Unity > Preferences and open External Tools.
Uncheck the box marked "Gradle Installed with Unity (recommended)" and enter the path to the Gradle you just placed.
Now the Gradle used for building has been switched to a different version.
If there are no problems with the version, you should now be able to build Android.
[출처] https://github.com/googleads/googleads-mobile-unity/issues/2390