未找到Google Play服务资源

问题描述 投票:9回答:5

我使用SDK管理器更新SDK,更新SDK“google-play-services_lib”后没有得到遵守,它显示以下错误。

**extras\google\google_play_services\libproject\google-play-services_lib\res\values-v11\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar'.

extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.

 extras\google\google_play_services\libproject\google-play-services_lib\res\values-v11\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar'.

 extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.**

任何帮助赞赏。

以下是xml(在“values-v11”下)给出错误,

<?xml version="1.0" encoding="utf-8"?>

<!-- Base preview application theme. -->
<style name="Theme.AppInvite.Preview.Base" parent="@android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar"/>

android google-maps google-play-services
5个回答
19
投票

这可能会解决您的问题

  1. 右键单击您的项目,选择Properties - > Select Android
  2. 在Project Build Target下,选中* Android 6.0或最新的API。
  3. 建立

一件重要的事情:导入库项目时总是复制到您的工作区。

更新: 原因:大部分时间谷歌播放服务从最新的API访问资源可用。这就是你需要瞄准最新目标的原因。


1
投票

这是它为我工作的解决方案(几个小时后):

1)从“Android SDK Manager”中取消Google Play服务Lib。它会询问您是否还要删除工作区中的目录。回答“是”

2)从“Android SDK Manager”再次下载Google Play Library,然后按照步骤将其导入您的工作区

3)为5.0.1的google-play-services-lib设置Android Target(这些是我工作的版本)

4)在要导入的项目中,右键单击 - > properties-> Android。再次添加google-play-services-lib库。

5)将项目的Android Target设置为5.0.1(与第3点相同的情况:我猜它可以用于其他版本)

6)只有在上述解决方案不起作用的情况下,将android-support-v4.jar从<...> / sdk / extras / android / support / v4复制到项目的“libs”文件夹中。

我希望这个对你有用


1
投票

对于新的Google Play服务,您需要更改project.properties文件(Google Play Services Lib项目,而不是您的项目)中的项目目标:

在以下文件中:

google-play-services_lib/project.properties

更改以下行

target=**android-9*

至:

target=**android-23**

0
投票

试图用android target-sdk-version="21"编译你的项目。它对我有用。


0
投票

我通过将minSdkVersion清单中的google-play-services_lib更改为我的应用程序使用的最小SDK版本来修复它。示例:<uses-sdk android:minSdkVersion="14"/>

© www.soinside.com 2019 - 2024. All rights reserved.