/ kyokomi note / blog

UaalでFirebaseSDKを組み込んでみる

June 8, 2020 [Android]

Unity as a LibraryでFIrebaseSDKを組み込んでみようとしたが残念だった結果のまとめ。

NativeAndroid側でFirebaseAuthで認証した情報をUnity側でも使えないかな〜と思ってとりあえず単純に組み込んでみた。

結論

普通にimportしても動かないので、諦めて自前で実装しましょう(終)

参考にした組み込み手順と実装

FirebaseSDKのimportで色々追加されてしまった(この時点でもう嫌な予感)

UnityEditorでのRunはできる。(それはそう)

既存のexportしてるやつを上書きしようとするとエラーになる。なるほどね。

別のフォルダにexportしたらなんと成功した。ただし、libsに色々Firebase関連のaarが入ってしまっている。

強引にsettings.gradleとかでincludeしてbuildしてみたが

include ':app'

// FirebaseSDKなしのexportしたunityLibrary
include ':unityLibrary'
project(':unityLibrary').projectDir=new File('../UnityProject/androidBuild/unityLibrary')

// FirebaseSDK込みのexportしたunityLibrary
include ':unityLibrary2'
project(':unityLibrary2').projectDir=new File('../UnityProject/androidFirebase/unityLibrary')

// Firebaseというディレクトリが生まれていたのでそれを無理やり外に出した
include ':firebase'
project(':firebase').projectDir=new File('../UnityProject/androidFirebase/firebase')

やっぱり、aar周りがLibraryとしてexportされる前提になっていので厳しそう。

Could not determine the dependencies of task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find :androidx.arch.core.core-runtime-2.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.asynclayoutinflater.asynclayoutinflater-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.coordinatorlayout.coordinatorlayout-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.core.core-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.cursoradapter.cursoradapter-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.customview.customview-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.documentfile.documentfile-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.drawerlayout.drawerlayout-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.fragment.fragment-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.interpolator.interpolator-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.legacy.legacy-support-core-ui-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.legacy.legacy-support-core-utils-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.lifecycle.lifecycle-livedata-2.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.lifecycle.lifecycle-livedata-core-2.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.lifecycle.lifecycle-runtime-2.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.lifecycle.lifecycle-viewmodel-2.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.loader.loader-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.localbroadcastmanager.localbroadcastmanager-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.print.print-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.slidingpanelayout.slidingpanelayout-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.swiperefreshlayout.swiperefreshlayout-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.versionedparcelable.versionedparcelable-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :androidx.viewpager.viewpager-1.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-ads-identifier-17.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-base-17.1.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-basement-17.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-measurement-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-measurement-api-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-measurement-base-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-measurement-impl-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-measurement-sdk-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-measurement-sdk-api-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-stats-17.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.android.gms.play-services-tasks-17.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-analytics-17.4.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-app-unity-6.15.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-auth-19.3.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-auth-interop-19.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-auth-unity-6.15.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-common-19.3.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-components-16.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-iid-20.1.5:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-iid-interop-17.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-installations-16.2.1:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-installations-interop-16.0.0:.
     Required by:
         project :app > project :unityLibrary2
   > Could not find :com.google.firebase.firebase-measurement-connector-18.0.0:.
     Required by:
         project :app > project :unityLibrary2

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

unityLibraryのbuild.gradleを適当にいじってbuildが通るようにしてみた。

が、だめ…もともとAndroid側でimplemntaionしてるのでぶつかった。

Duplicate class androidx.annotation.AnimRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.AnimatorRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.AnyRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.AnyThread found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.ArrayRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.AttrRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.BinderThread found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.BoolRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.CallSuper found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.CheckResult found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.ColorInt found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.ColorLong found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.ColorRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.ContentView found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.DimenRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.Dimension found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.DrawableRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.FloatRange found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.FontRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.FractionRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.GuardedBy found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.HalfFloat found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.IdRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.InspectableProperty found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.InspectableProperty$EnumEntry found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.InspectableProperty$FlagEntry found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.InspectableProperty$ValueType found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.IntDef found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.IntRange found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.IntegerRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.InterpolatorRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.Keep found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.LayoutRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.LongDef found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.MainThread found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.MenuRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.NavigationRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.NonNull found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.Nullable found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.PluralsRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.Px found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RawRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RequiresApi found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RequiresFeature found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RequiresPermission found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RequiresPermission$Read found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RequiresPermission$Write found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RestrictTo found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.RestrictTo$Scope found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.Size found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.StringDef found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.StringRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.StyleRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.StyleableRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.TransitionRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.UiThread found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.VisibleForTesting found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.WorkerThread found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.annotation.XmlRes found in modules annotation-1.1.0 (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0 (androidx.annotation:annotation:1.1.0)
Duplicate class androidx.arch.core.internal.FastSafeIterableMap found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap$AscendingIterator found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap$DescendingIterator found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap$Entry found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap$IteratorWithAdditions found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap$ListIterator found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.internal.SafeIterableMap$SupportRemove found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.arch.core.util.Function found in modules core-common-2.1.0 (androidx.arch.core:core-common:2.1.0) and jetified-androidx.arch.core.core-common-2.0 (androidx.arch.core.core-common-2.0.0.jar)
Duplicate class androidx.collection.ArrayMap found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.ArrayMap$1 found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.ArraySet found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.ArraySet$1 found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.CircularArray found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.CircularIntArray found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.ContainerHelpers found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.LongSparseArray found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.LruCache found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.MapCollections found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.MapCollections$ArrayIterator found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.MapCollections$EntrySet found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.MapCollections$KeySet found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.MapCollections$MapIterator found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.MapCollections$ValuesCollection found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.SimpleArrayMap found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.collection.SparseArrayCompat found in modules collection-1.1.0 (androidx.collection:collection:1.1.0) and jetified-androidx.collection.collection-1.0 (androidx.collection.collection-1.0.0.jar)
Duplicate class androidx.lifecycle.ClassesInfoCache found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.ClassesInfoCache$CallbackInfo found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.ClassesInfoCache$MethodReference found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.CompositeGeneratedAdaptersObserver found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.FullLifecycleObserver found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.FullLifecycleObserverAdapter found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.FullLifecycleObserverAdapter$1 found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.GeneratedAdapter found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.GenericLifecycleObserver found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.Lifecycle found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.Lifecycle$Event found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.Lifecycle$State found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.LifecycleObserver found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.LifecycleOwner found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.Lifecycling found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.MethodCallsLogger found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.OnLifecycleEvent found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.ReflectiveGenericLifecycleObserver found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class androidx.lifecycle.SingleGeneratedAdapterObserver found in modules jetified-androidx.lifecycle.lifecycle-common-2.0 (androidx.lifecycle.lifecycle-common-2.0.0.jar) and lifecycle-common-2.3.0-alpha03 (androidx.lifecycle:lifecycle-common:2.3.0-alpha03)
Duplicate class com.google.auto.value.AutoAnnotation found in modules jetified-auto-value-annotations-1.6.5 (com.google.auto.value.auto-value-annotations-1.6.5.jar) and jetified-auto-value-annotations-1.6.5 (com.google.auto.value:auto-value-annotations:1.6.5)
Duplicate class com.google.auto.value.AutoOneOf found in modules jetified-auto-value-annotations-1.6.5 (com.google.auto.value.auto-value-annotations-1.6.5.jar) and jetified-auto-value-annotations-1.6.5 (com.google.auto.value:auto-value-annotations:1.6.5)
Duplicate class com.google.auto.value.AutoValue found in modules jetified-auto-value-annotations-1.6.5 (com.google.auto.value.auto-value-annotations-1.6.5.jar) and jetified-auto-value-annotations-1.6.5 (com.google.auto.value:auto-value-annotations:1.6.5)
Duplicate class com.google.auto.value.AutoValue$Builder found in modules jetified-auto-value-annotations-1.6.5 (com.google.auto.value.auto-value-annotations-1.6.5.jar) and jetified-auto-value-annotations-1.6.5 (com.google.auto.value:auto-value-annotations:1.6.5)
Duplicate class com.google.auto.value.AutoValue$CopyAnnotations found in modules jetified-auto-value-annotations-1.6.5 (com.google.auto.value.auto-value-annotations-1.6.5.jar) and jetified-auto-value-annotations-1.6.5 (com.google.auto.value:auto-value-annotations:1.6.5)
Duplicate class com.google.auto.value.extension.memoized.Memoized found in modules jetified-auto-value-annotations-1.6.5 (com.google.auto.value.auto-value-annotations-1.6.5.jar) and jetified-auto-value-annotations-1.6.5 (com.google.auto.value:auto-value-annotations:1.6.5)

Go to the documentation to learn how to Fix dependency resolution errors.

ダメ元でlibs下のunity-classes.jar以外のaarとかを豪快に消してみる。

起動はしたが…、一生このエラーがでてる。 それはそう…って感じで終了。

2020-06-08 00:34:13.577 29275-29310/com.unity.mynativeapp E/Unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-6_15_0': The specified module could not be found.
      at Firebase.AppUtilPINVOKE.PollCallbacks () [0x00000] in <00000000000000000000000000000000>:0 
      at Firebase.AppUtil.PollCallbacks () [0x00000] in <00000000000000000000000000000000>:0 
      at Firebase.Platform.FirebaseHandler.Update () [0x00000] in <00000000000000000000000000000000>:0 
     
    (Filename: currently not available on il2cpp Line: -1)

まとめ

Unity as a LibraryでFirebaseSDKを公式の手順通り組むこんで動かすことはできない

last modified June 8, 2020

👋 Related posts in the uaal series...