Android resolver failed at build: "Failed to fetch the following dependencies: com.google.android:flexbox:+"

726 views Asked by At

I am trying to build an apk as development build but I get resolution failed error. I am adding the error message.

Before this fail I imported Admob Mediation Test Suite, maybe there is a link.

I get this error not just when I build also when I force resolve android resolver.

 Failed to fetch the following dependencies:
 com.google.android:flexbox:+
 
 
 UnityEngine.Debug:LogError (object)
 Google.Logger:Log (string,Google.LogLevel) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:136)
 GooglePlayServices.PlayServicesResolver:Log (string,Google.LogLevel) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1055)
 GooglePlayServices.GradleResolver:LogMissingDependenciesError (System.Collections.Generic.List`1<string>) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:95)
 GooglePlayServices.GradleResolver/<DoResolutionUnsafe>c__AnonStorey8:<>m__1 (System.Collections.Generic.List`1<Google.JarResolver.Dependency>) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:920)
 GooglePlayServices.GradleResolver/<GradleResolution>c__AnonStorey1:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:383)
 GooglePlayServices.GradleResolver/<GradleResolution>c__AnonStorey1:<>m__5 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:448)
 GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStoreyB:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1123)
 Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
 Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
 Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
 Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
 Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
 GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2359)
 GooglePlayServices.GradleResolver:ProcessAar (string) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
 GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStoreyB:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
 Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
 Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
 Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
 Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
 Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
 GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2359)
 GooglePlayServices.GradleResolver:ProcessAar (string) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
 GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStoreyB:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
 Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
 Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
 Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
 Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
 Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
 GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2359)
 GooglePlayServices.GradleResolver:ProcessAar (string) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
 GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStoreyB:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
 Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
 Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
 Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
 Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
 Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
 GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2359)
 GooglePlayServices.GradleResolver:ProcessAar (string) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
 GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStoreyB:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
 Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
 Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
 Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
 Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
 Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
 GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2359)
 GooglePlayServices.GradleResolver:ProcessAar (string) (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
 GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStoreyB:<>m__0 () (at Z:/tmp/tmp.QspB8317V7/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
 Google.RunOnMainThread:ExecutePollingJobs () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
 Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
 Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.0alLv6KzYu/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)

Update

I went through the documentations @Sandesh KhutalSaheb mentioned. I added the line in mainTemplate.gradle and it worked. Resolution succeeded. But apk build failed with this error message:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class com.google.android.flexbox.AlignContent found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.AlignItems found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.AlignSelf found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexContainer found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexDirection found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexItem found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexLine found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexWrap found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxHelper found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxHelper$1 found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxHelper$FlexLinesResult found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxHelper$Order found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxItemDecoration found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayout found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayout$DividerMode found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayout$LayoutParams found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayout$LayoutParams$1 found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$1 found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$AnchorInfo found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$LayoutParams found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$LayoutParams$1 found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$LayoutState found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$SavedState found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.FlexboxLayoutManager$SavedState$1 found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
  Duplicate class com.google.android.flexbox.JustifyContent found in modules classes.jar (com.google.android.flexbox:flexbox:3.0.0) and classes.jar (com.google.android:flexbox:1.1.1)
1

There are 1 answers

5
Sandesh Khutal On

Add the following dependency to your build.gradle file:

dependencies {
    implementation 'com.google.android.flexbox:flexbox:3.0.0'
}