Symptoms:
- Gradle build errors on Andorid platform using Unity 4.12.0 and above
- Unity version 2020 and above
Cause:
In IAP 4.12.0, we updated to Google Play Billing Library 6 which introduced a new dependency which required us to support it.
Resolution:
1. Using EDM4U (External Dependency Manager for Unity)
- Verify if your project contains both EDM4U and MDR (Mobile Dependency Resolver). If it has both, remove MDR.
- In the Project Settings, under Player → Publishing Settings for Android,
- enable Custom Main Gradle Template
- enable Custom Gradle Properties Template
- Go to Assets → External Dependency Manager → Android Resolver → Settings.
- Enable Patch mainTemplate.gradle
- Enable Copy and patch settingsTemplate.gradle from 2022.2
*NB if the above settings aren't visible update your External Dependency Manager
- Go to Assets → External Dependency Manager → Android Resolver → Force Resolve
2. If your project has Google Mobile Ads and you are receiving this error:
Cannot change dependencies of dependency configuration ‘:unityLibrary:implementation’ after it has been included in dependency resolution.
In Assets → Google Mobile Ads → Settings
- Disable the Remove property tag from GMA Android SDK
3. If you get the following error:
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
Go in Unity → Settings → External Tools, then disable and reenable the Android JDK, SDK and NDK.
More information:
https://discussions.unity.com/t/iap-4-12-0-solutions-to-android-build-issues/1503523
Comments
0 comments
Article is closed for comments.