Search Unity

Unity Error JarResolver, Gradle build failed

Discussion in 'Asset Bundles' started by acbirja, Jan 5, 2019.

  1. acbirja

    acbirja

    Joined:
    Jan 5, 2019
    Posts:
    1
    Hello,
    Few days ago we had bought mobile game "Block Legend - Unity Android Game Template" on the website codecanyon. When the first time we have opened Template unity application shows the next problem on the console:

    Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-base:[11.0.4]
    at Google.JarResolver.PlayServicesSupport.GetDependencies (Google.JarResolver.Dependency dep) [0x001df] in <f83d05066c7d47f3977a6a45d64c1dff>:0
    at Google.JarResolver.PlayServicesSupport.ResolveDependencies (System.Boolean useLatest, System.String destDirectory) [0x003ae] in <f83d05066c7d47f3977a6a45d64c1dff>:0
    at GooglePlayServices.ResolverVer1_1.DoResolutionNoAndroidPackageChecks (Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.PlayServicesSupport+OverwriteConfirmation handleOverwriteConfirmation) [0x00000] in <f83d05066c7d47f3977a6a45d64c1dff>:0
    UnityEngine.Debug:LogError(Object)
    GooglePlayServices.ResolverVer1_1:DoResolutionNoAndroidPackageChecks(PlayServicesSupport, String, OverwriteConfirmation)
    GooglePlayServices.<DoResolution>c__AnonStorey5:<>m__8()
    GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
    GooglePlayServices.PlayServicesResolver:Resolve(Action)
    GooglePlayServices.PlayServicesResolver:AutoResolve()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Edit your settings in user guide. For getting android .apk we make "build" , but applicstions shows this problem.

    CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

    stderr[
    D:\BlockLegendTemplate\Temp\gradleOut\src\main\AndroidManifest.xml:4:58-89 Error:
    Attribute application@icon value=(@Mipmap/app_icon) from AndroidManifest.xml:4:58-89
    is also present at [:mobile-native-popups:] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:4:3-16:17 to override.
    D:\BlockLegendTemplate\Temp\gradleOut\src\main\AndroidManifest.xml:4:16-57 Error:
    Attribute application@theme value=(@StyLe/UnityThemeSelector) from AndroidManifest.xml:4:16-57
    is also present at [:mobile-native-popups:] AndroidManifest.xml:15:9-40 value=(@StyLe/AppTheme).
    Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:4:3-16:17 to override.

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':processReleaseManifest'.
    > Manifest merger failed with multiple errors, see logs

    * 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 UP-TO-DATE
    reBuild UP-TO-DATE
    :GoogleMobileAdsPlugin:preBuild UP-TO-DATE
    :GoogleMobileAdsPlugin:preReleaseBuild UP-TO-DATE
    :GoogleMobileAdsPlugin:checkReleaseManifest
    :GoogleMobileAdsPlugin:processReleaseManifest
    :MainLibProj:preBuild UP-TO-DATE
    :MainLibProj:preReleaseBuild UP-TO-DATE
    :MainLibProj:checkReleaseManifest
    :MainLibProj:processReleaseManifest
    reReleaseBuild
    :GoogleMobileAdsPlugin:compileReleaseAidl NO-SOURCE
    :MainLibProj:compileReleaseAidl NO-SOURCE
    :compileReleaseAidl NO-SOURCE
    :GoogleMobileAdsPlugin:packageReleaseRenderscript NO-SOURCE
    :MainLibProj:packageReleaseRenderscript NO-SOURCE
    :compileReleaseRenderscript UP-TO-DATE
    :checkReleaseManifest UP-TO-DATE
    :generateReleaseBuildConfig UP-TO-DATE
    repareLintJar UP-TO-DATE
    :mainApkListPersistenceRelease UP-TO-DATE
    :generateReleaseResValues UP-TO-DATE
    Gradle | Search for Help with Gradle
    [Photo]
    :generateReleaseResources UP-TO-DATE
    :GoogleMobileAdsPlugin:compileReleaseRenderscript
    :GoogleMobileAdsPlugin:generateReleaseResValues
    :GoogleMobileAdsPlugin:generateReleaseResources
    :GoogleMobileAdsPlugin:packageReleaseResources
    :MainLibProj:compileReleaseRenderscript
    :MainLibProj:generateReleaseResValues
    :MainLibProj:generateReleaseResources
    :MainLibProj:packageReleaseResources
    :mergeReleaseResources UP-TO-DATE
    :createReleaseCompatibleScreenManifests UP-TO-DATE
    rocessReleaseManifest

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

    rocessReleaseManifest FAILED
    21 actionable tasks: 12 executed, 9 up-to-date
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Andr
    Gradle | Search for Help with Gradle
    [Photo]
    oid.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <e1c3953b4cf040ddb1400046b1c34897>: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 <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <e1c3953b4cf040ddb1400046b1c34897>: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 <e1c3953b4cf040ddb1400046b1c34897>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <e1c3953b4cf040ddb1400046b1c34897>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:286)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    How we can solve this problem?

    Thanks
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,184
    See the Unity manual page about "Gradle troubleshooting". It should cover the most common errors and what to do in order to resolve them.

    BTW - i specialize in such cases so feel free to reach out (via link in my signature).