经过大量的重新安装和其他更改后,我发现了2个错误。当我打开Unity以及进行Android构建时,这两个错误都会出现。尽管出现了这些错误,但看起来构建工作似乎有效(游戏有奇怪的问题并且运行缓慢,但我认为这并不相关)。
1。 Gradle无法获取依赖项。
Failed to run 'F:\Projects\CompanyName\GameName\Game\Temp\PlayServicesResolverGradle\gradlew.bat -b "F:\Projects\MAWGames\Gnome Invaders\Game\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --no-daemon "-PANDROID_HOME=F:/Programs/AndroidSDK" "-PTARGET_DIR=F:\Projects\MAWGames\Gnome Invaders\Game\Assets\Plugins\Android" "-PMAVEN_REPOS=" "-PPACKAGES_TO_COPY=com.google.android.gms:play-services-gcm:+;com.google.android.gms:play-services-location:+;com.android.support:customtabs:+;com.android.support:support-v4:+"'
* Where:
Build file 'F:\Projects\CompanyName\GameName\Game\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle' line: 127
* What went wrong:
A problem occurred evaluating root project 'PlayServicesResolverGradle'.
> For input string: "0-alpha1"
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__1F(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__28()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
2。无法找到Android SDK管理器工具
The following Required Android packages cannot be installed:
* extras;google;m2repository
* extras;android;m2repository
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<InstallAndroidSdkPackagesAndResolve>c__AnonStorey19:<>m__27(IAndroidSdkManager)
GooglePlayServices.<Create>c__AnonStoreyA:<>m__D(Boolean)
GooglePlayServices.<InstallPackages>c__AnonStorey5:<>m__5(Result)
GooglePlayServices.<DisplayInstallLicenseDialog>c__AnonStorey6:<>m__6(Result)
GooglePlayServices.ProgressReporter:Update(CommandLineDialog)
GooglePlayServices.CommandLineDialog:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
我在2个错误之间看到了GooglePlayServices主题。我通过sdkmanager的命令行使用安装了该软件包,但是我卸载了它并且它似乎并不重要。已经在项目中添加了一个解析器(我相信因为使用了OneSignal),也许我需要最新的?
以下是我安装的软件包,他们希望我更新的工具版本以及来自Unity的弹出式对话框(粘贴在那里)的快照。
我更喜欢通过Unity更新工具,因为当我尝试将SDKManager工具复制到另一个目录时(这样我就可以实际更新它们,否则访问将被拒绝,因为它正在更新该文件夹中)并设置--sdk_root,没有任何反应。根没有设置,命令似乎被忽略了!如果我能让Unity为我做这件事,那太棒了。
无论如何,我很欣赏这方面的帮助,所有的篮球都几乎被淘汰了。
谢谢! -Matt