AppLovin / AppLovin-MAX-Unity-Plugin

115 stars 31 forks source link

Android build fails in Unity 6 Preview #376

Open KJJ-shokk opened 1 month ago

KJJ-shokk commented 1 month ago

MAX Plugin Version

6.5.1

Unity Version

6000.0.2f1

Device/Platform Info

Android

Current Behavior

If you create an empty project in Unity 6 and build Android with only MaxSDK, the build fails due to a Gradle error.

Expected Behavior

It works normally until Unity 2022.3.

How to Reproduce

  1. Create an empty project
  2. Change build environment to Android
  3. Import MaxSDK
  4. Start Android build
  5. Gradle error occurs

Additional Info

No response

JonathanLiuApp commented 1 month ago

@KJJ-shokk Could you share what specific errors occurred for you? I created an empty project with MAX Plugin Version 6.5.2 and I was able to export and run the project after removing android.enableDexingArtifactTransform. You can do this by commenting out the line gradlePropertiesUpdated.Add(PropertyDexingArtifactTransform + DisableProperty); in AppLovinPostProcessAndroid.cs. Can you confirm whether that works for you as well?

KJJ-shokk commented 1 month ago

@JonathanLiuApp That's the solution to my problem!!! Android build was successful. What's the problem with this?

JonathanLiuApp commented 1 month ago

Great to hear that worked! Unity 6 uses Gradle version 8.4, but enableDexingArtifactTransform was removed in version 8.2 so the build would fail.

We'll add a fix for this in an upcoming release and update here when it is out.

hunght85 commented 1 month ago

Hello I was commenting out the line gradlePropertiesUpdated.Add(PropertyDexingArtifactTransform + DisableProperty); in AppLovinPostProcessAndroid.cs but I still get error logs below: [SafeDK-ERROR] Android variants not detected. Please make sure you place the directive: apply plugin: 'applovin' after you apply the Android plugin in your build.gradle file