Android Firebase Unity有错误:Gradle无法获取依赖项并且解析失败,DllNotFoundException:FirebaseCppApp-5.2.0

时间:2018-08-01 08:42:15

标签: android firebase unity3d compiler-errors

我需要一些帮助。 我无法在Android平台中使用Firebase。解决Android Resolver时出现错误。 我找不到解决我问题的方法。 我该如何解决这个问题。你可以帮助我,或者你知道谁可以帮助我

我的软件配置:

<?php $foo = $foo ?? 'default value'; ?>

团结LogFile

单位错误:

Firebase Unity SDK 5.2.0
Android NDK r13b
Android SDK Full Update
JDK 8u181
JRE 8u181
Windows 7
Unity 2018.2.1f1

Image of Gradle failed to fetch dependencies

Gradle failed to fetch dependencies.

Failed to run 'C:\Users\Arman\Desktop\TestFireBaseUnity\Temp\PlayServicesResolverGradle\gradlew.bat -b "C:\Users\Arman\Desktop\TestFireBaseUnity\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --no-daemon "-PANDROID_HOME=C:/Android_SDK" "-PTARGET_DIR=C:\Users\Arman\Desktop\TestFireBaseUnity\Assets\Plugins\Android" "-PMAVEN_REPOS=file:///C:/Users/Arman/Desktop/TestFireBaseUnity/Assets/Firebase/m2repository" "-PPACKAGES_TO_COPY=com.google.android.gms:play-services-base:15.0.1;com.google.firebase:firebase-common:16.0.0;com.google.firebase:firebase-core:16.0.1;com.google.firebase:firebase-app-unity:5.2.0;com.google.firebase:firebase-iid:16.2.0;com.google.firebase:firebase-messaging:17.1.0;com.google.firebase:firebase-messaging-unity:5.2.0"'
stdout:
Unzipping C:\Users\Arman\.gradle\wrapper\dists\gradle-4.2.1-bin\dajvke9o8kmaxbu0kc5gcgeju\gradle-4.2.1-bin.zip to C:\Users\Arman\.gradle\wrapper\dists\gradle-4.2.1-bin\dajvke9o8kmaxbu0kc5gcgeju

stderr:
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:225)
    at java.util.zip.ZipFile.<init>(ZipFile.java:155)
    at java.util.zip.ZipFile.<init>(ZipFile.java:169)
    at org.gradle.wrapper.Install.unzip(Install.java:215)
    at org.gradle.wrapper.Install.access$600(Install.java:27)
    at org.gradle.wrapper.Install$1.call(Install.java:75)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

exit code: 1

UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__0(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey1:<>m__0()
Google.RunOnMainThread:ExecuteNext()
Google.RunOnMainThread:ExecuteAll()
Google.RunOnMainThread:Run(Action, Boolean)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__1(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__2(Result)
GooglePlayServices.ProgressReporter:SignalComplete()
GooglePlayServices.ProgressReporter:Update(CommandLineDialog)
GooglePlayServices.CommandLineDialog:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Image of Error Resolution failed

Android解析器也出错:

Image of Android Resolver Settings

Image of Resolver Error

设备监视器中的错误:

Resolution failed

Failed to fetch the following dependencies:
com.google.android.gms:play-services-base:15.0.1
com.google.firebase:firebase-common:16.0.0
com.google.firebase:firebase-core:16.0.1
com.google.firebase:firebase-app-unity:5.2.0
com.google.firebase:firebase-iid:16.2.0
com.google.firebase:firebase-messaging:17.1.0
com.google.firebase:firebase-messaging-unity:5.2.0


UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.ResolverVer1_1:LogMissingDependenciesError(List`1)
GooglePlayServices.<DoResolutionUnsafe>c__AnonStorey4:<>m__1(List`1)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__0(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey1:<>m__0()
Google.RunOnMainThread:ExecuteNext()
Google.RunOnMainThread:ExecuteAll()
Google.RunOnMainThread:Run(Action, Boolean)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__1(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey0:<>m__2(Result)
GooglePlayServices.ProgressReporter:SignalComplete()
GooglePlayServices.ProgressReporter:Update(CommandLineDialog)
GooglePlayServices.CommandLineDialog:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Image of Monitor Error

下载Source

[解决了我的问题]

我的问题是Android SDK构建工具和工具版本。

Android SDK已更新,但是在build-tools目录中,有一个名为“ android-4.2.2”的旧目录通过删除它解决了该问题。

我还将Android SDK工具版本从26.1.1降级到25.2.5

2 个答案:

答案 0 :(得分:1)

尝试安装Google Play解析器(https://github.com/googlesamples/unity-jar-resolver)。步骤如下:

  1. 下载资源库中的unity软件包。不要下载发行版本,它们已经过时了。我在这里https://github.com/googlesamples/unity-jar-resolver/blob/master/play-services-resolver-1.2.80.0.unitypackage
  2. 下载了它
  3. 导入包后,转到资产> Play服务解析器>更新
  4. 更新所有内容后,打开Assets > Play Services Resolver > Android > Settings。我检查了这些设置 enter image description here
  5. 运行Assets > Play Services Resolver > Android > Force Update

答案 1 :(得分:0)