Open martingoldschmid opened 3 years ago
We will try to reproduce this problem on our end.
It looks like the error is Program type already present: com.android.billingclient.BuildConfig
This library could be included twice, does not look like the AppsFlyer problem.
@martingoldschmid we tried to reproduce the issue and we were not able to. Try to remove the extra dependencies. There is no need to add the dependencies in build.gradle. They are added automatically.
The only action required is to add oaid_sdk_1.9.23.aar to assets > plugins > android
Thank you guys for your help,
I got confused because the tutorial and the documentation seemed to recommend to add these depedencies,
If this is done automatically in the build I won't worry about it and it should compile.
Link of the tutorial: https://support.appsflyer.com/hc/en-us/articles/360006278797-Android-OAID-implementation-in-the-SDK#supported-devices
Add OAID dependencies; they must support the manufacturer's standalone JAR file in the app-level build.gradle file:
implementation 'com.appsflyer:af-android-sdk:5.4.3@aar'
implementation 'com.appsflyer:oaid:6.1.1'
implementation files('libs/oaid_sdk_1.0.23.aar')
Hey guys,
I'm trying to integrate the OAID collection to my Unity game project "Mirages of Winter" appsflyer account: martingoldschmid@mirarigames.com
Issue: The build process get stuck at the end during or right after "unity build failure android task transform Classes DexBuilder Release UP-TO-DATE"
Here's my setup:
I can build an .apk in Unity just fine without the oaid_sdk_1.0.23.aar (last version downloaded today 12/18/2020) that I integrated in the unity project folder: assets>plugins>android
The min android api level is 21, Unity version 2018.3.11f1
The added dependencies in the .gradle may be the problem since I'm not experienced with it, I tried every combinaison that I could think of relating the 3 depedencies that were suggested in the tutorial:
Here's the .gradle
CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity2018.3\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity2018.3\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[ D8: Program type already present: com.android.billingclient.BuildConfig
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForRelease'. > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\0.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\1.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\2.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\3.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\4.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\5.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\6.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\7.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\8.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\9.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\10.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\11.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\12.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\13.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\14.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\15.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\16.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\17.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\18.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\19.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\20.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\21.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\22.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\23.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\24.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\25.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\26.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\27.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\28.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\29.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\32.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\40.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\42.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\43.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\44.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\45.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\46.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\47.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\48.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\49.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\50.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\51.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\52.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\53.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\54.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\55.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\56.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\57.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\58.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\59.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\60.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\61.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\62.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\63.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\64.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\65.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\66.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\67.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\68.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\69.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\70.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\71.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\72.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\73.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\74.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\75.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\76.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\77.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\78.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\79.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\80.jar, C:\Users\marti_000\Documents\GitHub\Mirages-Tactile\Temp\gradleOut\build\intermediates\transforms\dexBuilder\release\81.jar Program type already present: com.android.billingclient.BuildConfig Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. * 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 21s ] stdout[ Observed package id 'tools' in inconsistent location 'C:\Users\marti_000\AppData\Local\Android\Sdk\tools_new' (Expected 'C:\Users\marti_000\AppData\Local\Android\Sdk\tools') Already observed package id 'tools' in 'C:\Users\marti_000\AppData\Local\Android\Sdk\tools'. Skipping duplicate at 'C:\Users\marti_000\AppData\Local\Android\Sdk\tools_new' :checkReleaseClasspath :preBuild UP-TO-DATE :preReleaseBuild UP-TO-DATE :compileReleaseAidl NO-SOURCE :compileReleaseRenderscript :checkReleaseManifest UP-TO-DATE :generateReleaseBuildConfig UP-TO-DATE :prepareLintJar UP-TO-DATE :mainApkListPersistenceRelease UP-TO-DATE :generateReleaseResValues UP-TO-DATE :generateReleaseResources :mergeReleaseResources UP-TO-DATE :createReleaseCompatibleScreenManifests UP-TO-DATE :processReleaseManifest :splitsDiscoveryTaskRelease UP-TO-DATE :processReleaseResources :generateReleaseSources :javaPreCompileRelease :compileReleaseJavaWithJavac :compileReleaseNdk NO-SOURCE :compileReleaseSources :lintVitalRelease :mergeReleaseShaders UP-TO-DATE :compileReleaseShaders UP-TO-DATE :generateReleaseAssets UP-TO-DATE :mergeReleaseAssets :transformClassesWithDexBuilderForRelease UP-TO-DATE :transformDexArchiveWithExternalLibsDexMergerForRelease FAILED 21 actionable tasks: 9 executed, 12 up-to-date ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at :0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)