AppLovin / AppLovin-MAX-Unity-Plugin

127 stars 35 forks source link

Unity 6 Preview build error #389

Closed hunght85 closed 5 months ago

hunght85 commented 5 months ago

MAX Plugin Version

6.5.2

Unity Version

Unity 6000.0.1

Device/Platform Info

Android 14

Current Behavior

Error android build

Expected Behavior

No response

How to Reproduce

[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

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

Additional Info

No response

santoshbagadi commented 5 months ago

@hunght85 , we're going to release a new version of our plugin that will fix this issue. In the mean time do you mind trying the workaround mentioned here: https://github.com/AppLovin/AppLovin-MAX-Unity-Plugin/issues/376#issuecomment-2121341734

Also, going to close this as duplicate.

JonathanLiuApp commented 5 months ago

@hunght85 I was not able to reproduce your error in Unity 6 preview. Could you share the gradle files in your project? Could you also check if you are able to reproduce this in our demo app?

hunght85 commented 5 months ago

Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :launcher

AppLovin Quality Service Plug-in for Gradle and Android Studio Version 5.2.7 Copyright (c) 2024 AppLovin Ltd. All rights reserved.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

Screenshot 2024-06-05 at 09 20 27

BELOW IS CUSTOM MAIN GRADLE: apply plugin: 'com.android.library' apply plugin: 'applovin' APPLY_PLUGINS

dependencies { implementation "androidx.startup:startup-runtime:1.1.1" implementation "androidx.fragment:fragment:1.6.2" implementation fileTree(dir: 'libs', include: ['*.jar']) // Android Resolver Dependencies Start implementation 'com.applovin.mediation:google-adapter:[23.0.0.1]' // Assets/MaxSdk/Mediation/Google/Editor/Dependencies.xml:5 implementation 'com.applovin.mediation:unityads-adapter:4.10.0.0' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4 implementation 'com.applovin:applovin-sdk:12.4.2' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:4 implementation 'com.google.android.ump:user-messaging-platform:2.1.0' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:5 // Android Resolver Dependencies End DEPS}

// Android Resolver Exclusions Start android { packaging { exclude ('/lib/armeabi/' + '') exclude ('/lib/armeabi-v7a/' + '') exclude ('/lib/mips/' + '') exclude ('/lib/mips64/' + '') exclude ('/lib/x86/' + '') exclude ('/lib/x86_64/' + '') } } // Android Resolver Exclusions End android { ndkPath "NDKPATH"

compileSdk **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'

compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
    minSdk **MINSDK**
    targetSdk **TARGETSDK**
    ndk {
        abiFilters **ABIFILTERS**
    }
    versionCode **VERSIONCODE**
    versionName '**VERSIONNAME**'
    consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
}

lint {
    abortOnError false
}

androidResources {
    noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
    ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
}**PACKAGING**

} IL_CPP_BUILD_SETUP SOURCE_BUILD_SETUP EXTERNAL_SOURCES

JonathanLiuApp commented 5 months ago

Could you check that you have Custom Main Gradle Template, Custom Base Gradle Template, and Custom Gradle Properties Template enabled in your project settings? If not, could you enable them, resolve dependencies using the External Dependency Manager, and try to build again?

hunght85 commented 5 months ago
Screenshot 2024-06-07 at 03 57 31

I had all of them and try resolve dependencies using the External Dependency Manage but nothing changed.

santoshbagadi commented 5 months ago

Was this app updated from an older version of Unity? If so, the gradle templates might be old and you may have to re-generate them by disabling and re-enabling the templates.

hunght85 commented 5 months ago

Was this app updated from an older version of Unity? If so, the gradle templates might be old and you may have to re-generate them by disabling and re-enabling the templates.

That's is exactly reason. After delete all file and re-check option, I build success for android. Thank you all for great support

huy24112001 commented 4 months ago

i have a same problem . What files do I need to delete? @hunght85

hunght85 commented 4 months ago

i have a same problem . What files do I need to delete? @hunght85 Bạn xóa hết file trong Asset -> Plugin -> Android. . rồi tick lại trong player setting