AppLovin / AppLovin-MAX-Unity-Plugin

116 stars 33 forks source link

Failed to add AppLovin Quality Service Plugin #220

Closed tomasd-ecorush closed 1 year ago

tomasd-ecorush commented 1 year ago

MAX Plugin Version

5.6.4

Unity Version

2022.2.2

Device/Platform Info

Unity Editor, Android Target

Current Behavior

This error shows in console after the build process

Error [AppLovin MAX] Failed to add AppLovin Quality Service plugin. Quality Service Plugin Added?: False, Quality Service Repo added?: False, Quality Service dependency added?: False UnityEngine.Debug:LogError (object) MaxSdkLogger:UserError (string) (at Assets/MaxSdk/Scripts/MaxSdkLogger.cs:55) AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinProcessGradleBuildFile:GenerateUpdatedBuildFileLines (System.Collections.Generic.List1,string,bool) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs:415) AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinProcessGradleBuildFile:AddQualityServiceBuildScriptLines (string) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs:115) AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinPostProcessGradleProject:OnPostGenerateGradleAndroidProject (string) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroidGradle.cs:30) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)`

Expected Behavior

The build process will complete without errors.

How to Reproduce

  1. Import Applovin MAX 5.6.4
  2. Enable checkbox "Enable MAX Ad Review" and paste Applovin SDK Key
  3. Build APK

Additional Info

No response

alvarshahanji commented 1 year ago

Hi, it seems like the issue started specifically with Unity 2022.2.0. Unity has significantly changed the how Gradle files are generated. We'll have a fix for it in the next release.

If you have unchecked the Enable Ad Review setting in our Integration Manager and still see the error, you can safely ignore it for now.

If you would like to get rid of the error, you can try adding the following line (shown with a + at the start) to the AppLovinPostProcessGradleProject file.

public void OnPostGenerateGradleAndroidProject(string path) {

if UNITY_2019_3_OR_NEWER

+            if (!AppLovinSettings.Instance.QualityServiceEnabled) return;

You can follow discussion on the same issue here as well

joshua-matchala commented 1 year ago

When is this going to be fixed? I was already told early January.. @alvarshahanji

santoshbagadi commented 1 year ago

This has been fixed in our latest Unity plugin version 5.6.5.

joshua-matchala commented 1 year ago

@santoshbagadi This is not fixed. It builds once, and if you do subsequent builds it fails with this error:

`CommandInvokationFailure: Gradle build failed. /Users/josh/Documents/UnityEditors/2022.2.2f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Users/josh/Documents/UnityEditors/2022.2.2f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

Environment Variables: BURST_ANDROID_MIN_API_LEVEL = 22 XPC_FLAGS = 0x0 JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8 MallocNanoZone = 0 ORIGINAL_XDG_CURRENT_DESKTOP = undefined SHELL = /bin/zsh SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.qR15c70ZSu/Listeners HOME = /Users/josh PATH = /usr/bin:/bin:/usr/sbin:/sbin CFBundleIdentifier = com.unity3d.unityhub USER = josh CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0 TMPDIR = /var/folders/yv/bss8v16d5n5grdvgj86_dk1c0000gn/T/ LOGNAME = josh JAVA_HOME = /Users/josh/Documents/UnityEditors/2022.2.2f1/PlaybackEngines/AndroidPlayer/OpenJDK ANDROID_NDK_ROOT = /Users/josh/Documents/UnityEditors/2022.2.2f1/PlaybackEngines/AndroidPlayer/NDK XPC_SERVICE_NAME = application.com.unity3d.unityhub.95309340.95309346 COMMAND_MODE = unix2003

stderr[ Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

BUILD FAILED in 1s ] stdout[

] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action1[T] progress) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action1[T] progress) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <78a7f7e9a87745b9a9f63bc62bfdda7d>:0) UnityEditor.BuildPipeline:BuildPlayer(EditorBuildSettingsScene[], String, BuildTarget, BuildOptions) BuildWindow:BuildAndRunAndroidToDevice(Boolean) (at Assets/Branch/Editor/BuildWindow.cs:147) BuildWindow:OnGUI() (at Assets/Branch/Editor/BuildWindow.cs:24) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

santoshbagadi commented 1 year ago

@joshua-matchala is this when building an .apk/ Build and Run or are you trying to export an Android project?

joshua-matchala commented 1 year ago

@santoshbagadi its a build and run to device.

santoshbagadi commented 1 year ago

Would you mind sharing the build.gradle file generated here: /Users/josh/Documents/GitHub/RyahsRhythm/Library/Bee/Android/Prj/IL2CPP/Gradle/build.gradle

joshua-matchala commented 1 year ago

@santoshbagadi

image
santoshbagadi commented 1 year ago

It is odd that the Ad Review plugin is not added, but the error message seems to suggest that it has been added twice. I've tried to reproduce the issue on Unity 2022.2.1f1 and was not able to.

Could you please try a clean build and then build on top to see if you are still seeing the issue.

Also, for my builds, Unity just seems to be re-creating all the build.gradle files again on each build. Do you know if you are using any new build settings that would cause Unity to not re-generate the gradle files?

joshua-matchala commented 1 year ago

I'm using

image

Also, if I delete the 'bee' folder, then it creates the apk just fine, but it takes a long time every time. Basically building if the bee folder already exists is causing the problem.

I don't do any manual handling of build.gradle file, so it should be regenerating each time.

@santoshbagadi

riverreal commented 1 year ago

@santoshbagadi Sorry for bringing this up again but the issue still persists. I'm currently using Unity 2022.2.18f1 (I have been consistently reproducing it in other 2022.2.xx versions), and the latest applovin plugin (5.9.0). Subsequent builds create this redundant line in the build.gradle

id 'com.applovin.quality' version '+' apply false // NOTE: Requires version 4.8.3+ for Gradle version 7.2+
id 'com.applovin.quality' version '+' apply false // NOTE: Requires version 4.8.3+ for Gradle version 7.2+

which makes the build fail.

So I have to manually remove both of them before building so it generates just one line and then succeeds with the build.

I think there is some setting somewhere in Unity that makes the build.gradle file not re-generate.

santoshbagadi commented 1 year ago

Hi @riverreal , do you mind checking if you are able to reproduce the issue with our demo app project: https://github.com/AppLovin/AppLovin-MAX-Unity-Plugin/tree/master/DemoApp

We've tried to reproduce the issue, but we are not able to on 2022.2.1. If you are able to reproduce the issue on a sample project, do you mind sharing the project with us, so that we can further investigate.

santoshbagadi commented 11 months ago

We've added a fix for this issue in our latest plugin version 5.11.0.

riverreal commented 11 months ago

Thank you. I will try it out when I have time. My apologies, I didn't have time to test the demo project.

0x00x0 commented 6 months ago

I have same issue. Any solutions? MAX Plugin Version 6.1.1

Unity Version 2022.3.11f1

Device/Platform Info Unity Editor, Android Target

santoshbagadi commented 6 months ago

@0x00x0 do you mind providing the error logs that you are seeing when trying to build.

0x00x0 commented 6 months ago

@santoshbagadi part of build log:

Gradle file properties : Gradle Version : 7.1.2 
Compile Sdk Version : 33 
Target Sdk Version : 29 
BuildToolsVersion : 34.0.0

   Call "AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinPostProcessGradleProject.OnPostGenerateGradleAndroidProject" from assembly 'MaxSdk.Scripts.IntegrationManager.Editor'
Error [AppLovin MAX] Failed to add AppLovin Quality Service plugin to root gradle file.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
MaxSdkLogger:UserError (string) (at Assets/MaxSdk/Scripts/MaxSdkLogger.cs:55)
AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinProcessGradleBuildFile:AddPluginToRootGradleBuildFile (string) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs:146)
AppLovinMax.Scripts.IntegrationManager.Editor.AppLovinPostProcessGradleProject:OnPostGenerateGradleAndroidProject (string) (at Assets/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroidGradle.cs:31)

Usage of gradle files image

baseProject.gradle

allprojects {
    buildscript {
        repositories {**ARTIFACTORYREPOSITORY**
            google()
            mavenCentral()
            gradlePluginPortal() 
        }

        dependencies {
            // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity
            // See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
            // See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
            // To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
            classpath 'com.android.tools.build:gradle:7.1.2'
            **BUILD_SCRIPT_DEPS**
        }
    }

    repositories {**ARTIFACTORYREPOSITORY**
        google()
        mavenCentral()
        gradlePluginPortal() 
        flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradleTemplate.properties

org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
org.gradle.parallel=true
android.enableR8=true
unityStreamingAssets=.unity3d**STREAMING_ASSETS**
# Android Resolver Properties Start
android.useAndroidX=true
android.enableJetifier=true
# Android Resolver Properties End
**ADDITIONAL_PROPERTIES**
android.useAndroidX = true
android.enableJetifier = true

launcherTemplate.gradle

apply plugin: 'com.android.application'

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
    }
}

dependencies {
    implementation project(':unityLibrary')
    }

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        multiDexEnabled true
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        applicationId '**APPLICATIONID**'
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        resConfigs "en", "US"
    }

    aaptOptions {
        noCompress = ['.unity3d', '.ress', '.resource', '.obb']+ unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**SIGN**

    lintOptions {
        abortOnError false
    }

    buildTypes {
        debug {
            minifyEnabled **MINIFY_DEBUG**

            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
            jniDebuggable true
        }
        release {
            minifyEnabled **MINIFY_RELEASE**

            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
        }
    }
}

mainTemplate.gradle

buildscript {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal() 
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal() 
        flatDir {
            dirs 'libs'
        }
    }
}

apply plugin: 'com.android.library'
dependencies {
    //id 'com.applovin.quality' version '+' apply false // NOTE: Requires version 4.8.3+ for Gradle version 7.2+
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.installreferrer:installreferrer:1.0'
    implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/GameAnalytics/Editor/Android/Dependencies.xml:5
    implementation 'com.google.android.gms:play-services-appset:16.0.2' // Assets/GameAnalytics/Editor/Android/Dependencies.xml:4
    implementation 'com.google.android.instantapps:instantapps:1.1.0' // Assets/GameAnalytics/Editor/Android/Dependencies.xml:3
// Android Resolver Dependencies Start
    implementation 'androidx.core:core:1.7.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:18
    implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:9
    implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
    implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    implementation 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
    implementation 'com.applovin.mediation:adcolony-adapter:4.8.0.4' // Assets/MaxSdk/Mediation/AdColony/Editor/Dependencies.xml:4
    implementation 'com.applovin.mediation:facebook-adapter:[6.14.0.0]' // Assets/MaxSdk/Mediation/Facebook/Editor/Dependencies.xml:8
    implementation 'com.applovin.mediation:fyber-adapter:8.2.3.3' // Assets/MaxSdk/Mediation/Fyber/Editor/Dependencies.xml:4
    implementation 'com.applovin.mediation:google-adapter:[22.1.0.3]' // Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml:5
    implementation 'com.applovin.mediation:ironsource-adapter:7.3.1.0.0' // Assets/MaxSdk/Mediation/IronSource/Editor/Dependencies.xml:8
    implementation 'com.applovin.mediation:mintegral-adapter:16.4.61.0' // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:8
    implementation 'com.applovin.mediation:mytarget-adapter:5.16.5.0' // Assets/MaxSdk/Mediation/MyTarget/Editor/Dependencies.xml:4
    implementation 'com.applovin.mediation:unityads-adapter:4.7.1.0' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4
    implementation 'com.applovin.mediation:vungle-adapter:6.12.1.1' // Assets/MaxSdk/Mediation/Vungle/Editor/Dependencies.xml:4
    implementation 'com.applovin.mediation:yandex-adapter:5.8.0.0' // Assets/MaxSdk/Mediation/Yandex/Editor/Dependencies.xml:4
    implementation 'com.applovin:applovin-sdk:12.1.0' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:4
    implementation 'com.appsflyer:adrevenue:6.9.1' // Assets/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:4
    implementation 'com.appsflyer:af-android-sdk:6.8.2' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
    implementation 'com.appsflyer:unity-adrevenue-generic-wrapper:6.9.1' // Assets/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:5
    implementation 'com.appsflyer:unity-wrapper:6.8.2' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
    implementation 'com.facebook.android:facebook-applinks:[14.1, 15)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:6
    implementation 'com.facebook.android:facebook-core:[14.1, 15)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:5
    implementation 'com.facebook.android:facebook-gamingservices:[14.1, 15)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:9
    implementation 'com.facebook.android:facebook-login:[14.1, 15)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:7
    implementation 'com.facebook.android:facebook-share:[14.1, 15)' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:8
    implementation 'com.google.android.gms:play-services-ads:22.5.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7
    implementation 'com.google.android.gms:play-services-auth:20.4.1+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:15
    implementation 'com.google.android.gms:play-services-base:18.1.0' // Assets/Firebase/Editor/AppDependencies.xml:17
    implementation 'com.google.android.gms:play-services-games:23.1.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:12
    implementation 'com.google.android.gms:play-services-nearby:17.0.0+' // Assets/Plugins/VoxelBusters/EssentialKit/Essentials/Editor/CrossPlatformEssentialKitDependencies.xml:13
    implementation 'com.google.android.play:asset-delivery:2.0.2' // Assets/GooglePlayPlugins/com.google.play.assetdelivery/Editor/Dependencies.xml:3
    implementation 'com.google.android.play:core-common:2.0.0' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3
    implementation 'com.google.android.ump:user-messaging-platform:2.1.0' // Assets/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7
    implementation 'com.google.firebase:firebase-analytics:21.2.0' // Assets/Firebase/Editor/RemoteConfigDependencies.xml:15
    implementation 'com.google.firebase:firebase-analytics-unity:10.4.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18
    implementation 'com.google.firebase:firebase-app-unity:10.4.0' // Assets/Firebase/Editor/AppDependencies.xml:22
    implementation 'com.google.firebase:firebase-common:20.3.0' // Assets/Firebase/Editor/AppDependencies.xml:13
    implementation 'com.google.firebase:firebase-config:21.2.1' // Assets/Firebase/Editor/RemoteConfigDependencies.xml:13
    implementation 'com.google.firebase:firebase-config-unity:10.4.0' // Assets/Firebase/Editor/RemoteConfigDependencies.xml:20
    implementation 'com.parse.bolts:bolts-android:1.4.0' // Assets/FacebookSDK/Plugins/Editor/Dependencies.xml:4
    implementation 'com.yandex.android:mobmetricalib:5.2.0' // Assets/AppMetrica/Editor/AppMetricaDependencies.xml:4
// Android Resolver Dependencies End
    **DEPS**
}

// Android Resolver Exclusions Start
android {
  packagingOptions {
      exclude ('/lib/armeabi/*' + '*')
      exclude ('/lib/mips/*' + '*')
      exclude ('/lib/mips64/*' + '*')
      exclude ('/lib/x86/*' + '*')
      exclude ('/lib/x86_64/*' + '*')
  }
}
// Android Resolver Exclusions End
android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    defaultConfig {
        multiDexEnabled true
        minSdkVersion 19
        targetSdkVersion 29
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'

    }

    dexOptions {
        preDexLibraries false
        javaMaxHeapSize "4g"
    }

    lintOptions {
        abortOnError false
    }

    packagingOptions {
       exclude  'jsr305_annotations/Jsr305_annotations.gwt.xml'
    }

    aaptOptions {
        noCompress '.unity3d', '.ress', '.resource', '.obb' + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }
    **SIGN**

    buildTypes {
        debug {
            jniDebuggable true
        }
        release {
            minifyEnabled false
            **SIGNCONFIG**
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}**REPOSITORIES**
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**

settingsTemplate.gradle

pluginManagement {
    repositories {
        **ARTIFACTORYREPOSITORY**
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}

include ':launcher', ':unityLibrary'
**INCLUDES**

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        **ARTIFACTORYREPOSITORY**
        google()
        mavenCentral()
// Android Resolver Repos Start
        def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
        maven {
            url (unityProjectPath + "/Assets/GeneratedLocalRepo/Firebase/m2repository") // Assets/Firebase/Editor/AnalyticsDependencies.xml:18, Assets/Firebase/Editor/AppDependencies.xml:22, Assets/Firebase/Editor/RemoteConfigDependencies.xml:20
        }
        maven {
            url "https://maven.google.com/" // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7, Assets/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7
        }
        maven {
            url "https://android-sdk.is.com/" // Assets/MaxSdk/Mediation/IronSource/Editor/Dependencies.xml:8
        }
        maven {
            url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:8
        }
        mavenLocal()
// Android Resolver Repos End
        flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }
    }
}

Also attached gradle files and properties baseProjectTemplate.txt gradleTemplate.txt launcherTemplate.txt mainTemplate.txt settingsTemplate.txt

Same story for Gradle Version : 4.2.0

UPD solved issue by regenerated baseProjectTemplate.gradle file and commented gradle tools version in other gradle files.

adizhavo commented 5 months ago

This issue still persists in some cases, the problem is that there are duplicate lines in the generated gradle.build under .Project...\Library\Bee\Android\Prj\IL2CPP\Gradle

Removing the duplicate line or deleting the file fixes the issue but it's until the next build gets made, this needs to be fixed from applovin