'How do I resolve Gradle Error:Colliding Attributes

I've been trying to build my project to an android gradle build but I'm continuing to get this error.

Gradle Error:Colliding Attributes The attribute meta-data#com.google.ar.core.min_apk_version@value=1810120000 in :core-1.4.0: collides with another value (See the Console for details)

I came across this forum with a similar issue (https://forum.unity.com/threads/problem-when-building-for-android.545594/) . The answer proposed (deleting core-1.1.4.arr) allows the project to build however the ARCore functionality isn't present. I've reinstalled ARCore/ARFoundation from the package manage with no luck as well.

Here's there error:

CommandInvokationFailure: Gradle build failed.
/Applications/Unity/Hub/Editor/2018.3.10f1/PlaybackEngines/AndroidPlayer/Tools/OpenJDK/MacOS/bin/java -classpath "/Applications/Unity/Hub/Editor/2018.3.10f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[
/Users/Jules/Desktop/Dragons Den/Dragon's Den/Temp/gradleOut/src/main/AndroidManifest.xml:43:13-38 Error:
   Attribute meta-data#com.google.ar.core.min_apk_version@value value=(181012000) from [:arcore_client:] AndroidManifest.xml:43:13-38
   is also present at [:core-1.4.0:] AndroidManifest.xml:43:13-38 value=(180626000).
   Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:41:9-43:41 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute meta-data#com.google.ar.core.min_apk_version@value value=(181012000) from [:arcore_client:] AndroidManifest.xml:43:13-38
     is also present at [:core-1.4.0:] AndroidManifest.xml:43:13-38 value=(180626000).
     Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:41:9-43:41 to override.

* 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 1s
]
stdout[
:checkReleaseClasspath
:preBuild UP-TO-DATE
:preReleaseBuild
:compileReleaseAidl NO-SOURCE
:compileReleaseRenderscript UP-TO-DATE
:checkReleaseManifest UP-TO-DATE
:generateReleaseBuildConfig UP-TO-DATE
:prepareLintJar UP-TO-DATE
:mainApkListPersistenceRelease UP-TO-DATE
:generateReleaseResValues UP-TO-DATE
:generateReleaseResources UP-TO-DATE
:mergeReleaseResources
:createReleaseCompatibleScreenManifests UP-TO-DATE
:processReleaseManifest

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:processReleaseManifest FAILED
11 actionable tasks: 4 executed, 7 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <df7ba4d130594d168eec372b930522d4>: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 <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <df7ba4d130594d168eec372b930522d4>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:286)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Any help would be appreciated, thanks!



Solution 1:[1]

Go to Assets/Plugins/Android and delete core-1.4.0.aar

Solution 2:[2]

I found an alternative solution to this, basically Vuforia has an option to build AR Core in ur Vuforia Configuration. It should be under Android Settings just un-check the box that sais include ARCore library and you should be good as gold.

Solution 3:[3]

just go to player settings -> other settings, on configurations uncheck x86 and x86-64 chrome OS and the target devices just chose phone, tablets and TV devices

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Metin Celik
Solution 2 Alexandre Elshobokshy
Solution 3 chandra