Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dexing Error when using Appsflyer 6.16.0 on Unity 2022.3.37f1 #317

Open
BollmanHutch opened this issue Jan 28, 2025 · 1 comment
Open

Dexing Error when using Appsflyer 6.16.0 on Unity 2022.3.37f1 #317

BollmanHutch opened this issue Jan 28, 2025 · 1 comment
Labels

Comments

@BollmanHutch
Copy link

Having updated to Appsflyer 6.16.0 I receive a Dexing error when building for Android.
Ive imported Appsflyer into an empty project and encounter the same issue.
It occurs when when mainTemplate.Grade is active in the project.

Repro Steps:

  1. Create an empty project or Use Existing
  2. Import Appsflyer 6.16.0
  3. Enable mainTemplate.gradle
  4. Build & Observe Error

Error:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Note: /Users/XXX/Documents/SourceTree/Project/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR:/Users/XXX/.gradle/caches/transforms-3/3ef65e31ceb024a249035a3568eed99d/transformed/jetified-af-android-sdk-6.16.0-runtime.jar: D8: com.android.tools.r8.internal.YI0: Sealed classes are not supported as program classes

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:mergeExtDexRelease'.
> Could not resolve all files for configuration ':launcher:releaseRuntimeClasspath'.
   > Failed to transform af-android-sdk-6.16.0.aar (com.appsflyer:af-android-sdk:6.16.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=false, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: /Users/XXX/.gradle/caches/transforms-3/3ef65e31ceb024a249035a3568eed99d/transformed/jetified-af-android-sdk-6.16.0-runtime.jar.
         > Error while dexing.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org/

BUILD FAILED in 1m 45s

UnityEditor.GenericMenu:CatchMenu (object,string[],int) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/GenericMenu.cs:127)

Additional Details:
minSDKTarget 24
TargetSDK 33
Unity Version: 2022.3.37f1
EDMU: 1.2.183

Temporary Solution:
I am able to get around the error by including the following into my settingsTemplate.gradle file

buildscript {
        repositories {
            mavenCentral()
            maven {
                url = uri("https://storage.googleapis.com/r8-releases/raw")
            }
        }
        dependencies {
            classpath("com.android.tools:r8:8.2.26")
        }
    }

Full settingsTemplate:

pluginManagement {
    buildscript {
        repositories {
            mavenCentral()
            maven {
                url = uri("https://storage.googleapis.com/r8-releases/raw")
            }
        }
        dependencies {
            classpath("com.android.tools:r8:8.2.26")
        }
    }
}

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

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        **ARTIFACTORYREPOSITORY**
        google()
        mavenCentral()
// Android Resolver Repos Start
        def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
        mavenLocal()
// Android Resolver Repos End
        flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }
    }
}

Full mainTemplate:

apply plugin: 'com.android.library'
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Resolver Dependencies Start
    implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
    implementation 'com.appsflyer:af-android-sdk:6.16.0' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
    implementation 'com.appsflyer:unity-wrapper:6.16.0' // Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
// Android Resolver Dependencies End
**DEPS**}

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

    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 33
        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**

@BollmanHutch BollmanHutch changed the title Dexing Error when using Appsflyer 6.16.0 on Unity 2022.4.37f1 Dexing Error when using Appsflyer 6.16.0 on Unity 2022.3.37f1 Jan 28, 2025
Copy link

👋 Hi @BollmanHutch and Thank you for reaching out to us.
In order for us to provide optimal support, please submit a ticket to our support team at [email protected].
When submitting the ticket, please specify:

  • ✅ your AppsFlyer sign-up (account) email
  • ✅ app ID
  • ✅ production steps
  • ✅ logs
  • ✅ code snippets
  • ✅ and any additional relevant information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants