AppLovin / AppLovin-MAX-Unity-Plugin

127 stars 35 forks source link

Android build fails in Unity 6 Preview #376

Closed KJJ-shokk closed 4 months ago

KJJ-shokk commented 6 months 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 6 months 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 6 months ago

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

JonathanLiuApp commented 6 months 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 5 months 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

JonathanLiuApp commented 4 months ago

This issue has been fixed in our latest plugin version 6.6.1.

harunayyildizhadi commented 2 days ago

radlePropertiesUpdated.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

What did you do to fix this? I'm getting this error on version 8.0.1