After updating the Unity Purchasing plugin to 4.12.2, we are experencing the following build issue,
A problem occurred evaluating project ‘:unityLibrary’.
Could not find method afterEvaluate() for arguments [build_b4cvnstzoh86pqopi2sr3nm85$_run_closure3@217f77b, build_b4cvnstzoh86pqopi2sr3nm85$_run_closure4@62d8e6dc] on project ‘:unityLibrary’ of type org.gradle.api.Project.
here is our Unity genarated maintemplate.gradle file.
apply plugin: 'com.android.library'
**APPLY_PLUGINS**
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
android {
namespace "com.unity3d.player"
ndkPath "**NDKPATH**"
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
}**PACKAGING_OPTIONS**
}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
We have tried upgrading Unity to 2022.3.39f1 and updating the Firebase plugins, but the error persists. If we downgrade the Unity Purchasing Plugin, everything works fine, but we cannot do that because Android requires an upgrade to the billing library before August 31st.
Tamal Mitra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.