简体   繁体   English

未找到Google Play服务资源

[英]Google play service resource not found

I have update SDK using SDK manger,after updating SDK "google-play-services_lib" not getting complied,Its showing following error. 我使用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'.**

Any Help appreciated. 任何帮助赞赏。

Following is xml(under "values-v11") which is giving error, 以下是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"/>

This may fix your problem 这可能会解决您的问题

  1. Right side click on your project select Properties -> Select Android 右键单击您的项目,选择Properties - > Select Android
  2. Under Project Build Target , check *Android 6.0 or to the latest API. Project Build Target下 ,选中* Android 6.0或最新的API。
  3. Build 建立

One important thing : While importing library projects always copy to your workspace. 一件重要的事情:导入库项目时总是复制到您的工作区。

UPDATED: 更新:
Reason : Most of time google play service lib access resources from lastest API available. 原因:大部分时间谷歌播放服务从最新的API访问资源可用。 that's why you need to target to the latest. 这就是你需要瞄准最新目标的原因。

This is the solution it worked for me (after a few hours): 这是它为我工作的解决方案(几个小时后):

1) Unistall the Google Play Services Lib from "Android SDK Manager". 1)从“Android SDK Manager”中取消Google Play服务Lib。 It will ask you if you want to delete also the directory in your workspace. 它会询问您是否还要删除工作区中的目录。 Answer "Yes" 回答“是”

2) Download again the Google Play Library from the "Android SDK Manager" and follow the steps to import it to your workspace 2)从“Android SDK Manager”再次下载Google Play Library,然后按照步骤将其导入您的工作区

3) Set Android Target for google-play-services-lib for 5.0.1 (these are the versions for me worked) 3)为5.0.1的google-play-services-lib设置Android Target(这些是我工作的版本)

4) In the project you want to import, right click->properties->Android . 4)在要导入的项目中,右键单击 - > properties-> Android。 Add again the google-play-services-lib library. 再次添加google-play-services-lib库。

5) Set Android Target for your project to 5.0.1 (the same case that point 3: I guess it can work for other versions) 5)将项目的Android Target设置为5.0.1(与第3点相同的情况:我猜它可以用于其他版本)

6) Only in case the above solution will not work, copy the android-support-v4.jar from <...>/sdk/extras/android/support/v4 to the "libs" folder of your project. 6)只有在上述解决方案不起作用的情况下,将android-support-v4.jar从<...> / sdk / extras / android / support / v4复制到项目的“libs”文件夹中。

I hope it works for you 我希望这个对你有用

For the new Google Play Services, you need change the project target in the project.properties file (The Google Play Services Lib project, not your project): 对于新的Google Play服务,您需要更改project.properties文件(Google Play Services Lib项目,而不是您的项目)中的项目目标:

In the below file: 在以下文件中:

google-play-services_lib/project.properties

Change the below line 更改以下行

target=**android-9*

to: 至:

target=**android-23**

Tried to compile your project with the android target-sdk-version="21" . 试图使用android target-sdk-version="21"编译你的项目。 It worked for me. 它对我有用。

I fixed it by changing the minSdkVersion in google-play-services_lib manifest to the minimum SDK version used by my app. 我通过minSdkVersion google-play-services_lib清单中的minSdkVersion更改为我的应用使用的最低SDK版本来修复它。 Example: <uses-sdk android:minSdkVersion="14"/> 示例: <uses-sdk android:minSdkVersion="14"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM