android - 找不到 google-play-services_lib

标签 android unity3d google-analytics google-play-services

我正在尝试将 Google Analytics(分析)集成到我的 Unity 游戏中。我已经下载并安装了 latest unitypackage .

在 Unity 中单击 Google Analytics > Setup > Install google-play-services_lib 后我收到此错误:

enter image description here

我已经在 Android SDK 管理器中安装了 Google Play 服务,但它没有安装库。甚至包的描述也说它只安装 JavaDoc 和示例代码,没有库:

GooglePlayServices installation screenshot

所以问题是在 /extras/google/google_play_services/ 文件夹中根本没有 libproject 子文件夹。只有 JavaDoc 和 Samples 文件夹。

我读过 the documentation (选择 OTHER,因为我既没有使用 Android Studio 也没有使用 Eclipse),按照说明一步一步操作,但它不起作用。我的谷歌搜索是徒劳的。如何安装 google play 服务库?

最佳答案

您是否尝试过检查设置 Google Play Services谷歌文档?

对于安卓工作室:

  1. Open the build.gradle file inside your application module directory.
  2. Add a new build rule under dependencies for the latest version of play-services. For example:

应用插件:'com.android.application' ...

依赖关系{ 编译 'com.google.android.gms:play-services:fp9.0.0'

  1. Save the changes and click Sync Project with Gradle Files in the toolbar.

Note: If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them. For information on how to do this, see Selectively compiling APIs into your executable.

对于带有 ADT 的 Eclipse:

  1. Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects.
  2. Import the library project into your Eclipse workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
  3. In your app project, reference Google Play services library project. See Referencing a Library Project for Eclipse for more information on how to do this.
  4. After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the <application> element:

关于android - 找不到 google-play-services_lib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37344706/

相关文章:

Android AlarmService 是怎样调度的?

android - 在 Android 上的动态壁纸中使用布局资源

c# - 如何防止在地形下移动相机 View ?

ios - Google Analytics for iOS 不发送事件

java - 错误: The markup in the document following the root element must be well-formed

java - 以编程方式更改首选项值后更新它们

android - 如何使用 Play 应用签名和应用程序包设置 Unity 应用程序并将其部署到 Google Play?

c# - Unity - 在两个相机上使用渲染纹理时,所有 Canvas 都变得不可见

python - URLlib 未显示在谷歌分析中

iOS 谷歌分析实现错误