【问题标题】:Android - Could not find google-play-services_lib.apk! errorAndroid - 找不到 google-play-services_lib.apk!错误
【发布时间】:2013-05-21 07:54:29
【问题描述】:

我正在尝试通过此链接使用新的 Google Play 服务进行 Google Plus 集成:http://ankitthakkar90.blogspot.sg/2013/05/google-plus-integration-in-android.html

除了尝试运行它时,我能够得到所有正确的东西,它给我提供了这个错误

Android Launch!
adb is running normally.
Performing com.anky.googleplus.MainActivity activity launch
Automatic Target Mode: using device 'CB5A1MQW4P'
Uploading GooglePlusDemo.apk onto device 'CB5A1MQW4P'
Installing GooglePlusDemo.apk...
Success!
Could not find google-play-services_lib.apk!
Starting activity com.anky.googleplus.MainActivity on device CB5A1MQW4P
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.anky.googleplus/.MainActivity }

我确实通过 eclipse Properties > Android > Add Library 引用了该库,就像这里所做的那样:Using the new Google Play Services 这个错误仍然出现。欢迎任何建议和反馈。

【问题讨论】:

    标签: android service shared-libraries runtime-error


    【解决方案1】:

    添加引用库时,我们只需要 google-play-services_lib.jar。所以我们需要从您的项目中删除该项目。

    Project->Properties->javaBuildPath->Project->选择 google-play-services->remove.

    清理并构建。

    【讨论】:

    • 如果 Google 自己的说明要求那样做,为什么其他方式行不通?啊。无论如何,非常感谢。这对我来说是固定的。
    • 为我修复了它。谢谢!
    • 呃,我只是引用了 jar。然后我遇到了另一个问题,所以我想我会仔细检查我的 Play Services 引用。我遇到了the instructions from Googleunexpected62 可能正在谈论。这似乎是正确的方法,所以我最终按照谷歌自己的指示打破了一切。感谢您再次澄清!
    • OMFG.. 非常感谢这个......我开始因为这个问题而脱发......
    • 天哪,它也对我有用!正如@Shradha 所说,我完全不知道为什么会这样
    【解决方案2】:

    好吧,我也遇到了同样的问题。然后我发现在从 Properties > Android > Add Library 引用它之前,我首先在 java 构建路径中错误地引用了它。 解决方案 首先从 java 构建和 Properties > Android > Add Library 中删除引用,然后再次从 Properties > Android > Add Library 中引用 google_Play_services_lib。 希望这会有所帮助:)

    【讨论】:

      【解决方案3】:

      您没有安装 google-play-services_lib APK,您应该在您的项目中将其作为 Android 库项目引用,并且 JAR 将包含在您的 APK 中。

      http://developer.android.com/google/play-services/setup.html

      这个链接教你如何引用一个android库项目:

      http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject

      【讨论】:

      • 我可以知道您指的是哪个 JAR 文件吗?是 android-support-v13.jar 吗?我按照其他步骤操作,问题仍然存在
      • 如果您将 google-play-services_lib 库正确设置为 Android 库项目,则会自动生成和引用 JAR 文件。您是否使用 Eclipse 来构建和运行您的代码?
      • 显然我没有为我的应用程序创建 oAuth。我通过以下链接解决了这个问题:developers.google.com/+/mobile/android/…
      【解决方案4】:

      在你的清单文件中把它放在里面

      <meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" />
      

      【讨论】:

        【解决方案5】:

        在我的情况下,通过选中 google-play-services_lib eclipse 项目 > 属性 > Java 构建路径 > 订单和导出选项卡中的 Android 私有依赖项复选框来修复此错误。在引用 google-play-services_lib 的主项目中也对其进行了检查。 我仍然在控制台中收到 Could not find google-play-services_lib.apk! 错误,但地图活动运行正常,而在更改之前,我遇到了运行时错误并且应用程序崩溃了。

        【讨论】:

          【解决方案6】:

          我的建议是将 google-play-services.jar 复制到项目的 libs 文件夹中。它对我有用。

          【讨论】:

            【解决方案7】:

            我认为您尝试运行 Google Play 服务的设备不包含 Google Play 服务 APK。

            查看 Android Developers 上的此链接以获得更多许可

            Ensuring Devices Have the Google Play services APK

            【讨论】:

            • 我很确定我有服务 apk,因为我可以在设置中的应用管理器中找到它
            【解决方案8】:

            检查库项目是否添加到项目中,如果没有则检查库项目和您的项目是否在同一目录中。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多