简体   繁体   English

在将Google Play服务位置添加为依赖关系后找不到资源标识符

[英]Resource Identifiers not found after adding Google Play Services Locations as Dependency

Here is what my build.gradle file looks like right now. 这是我的build.gradle文件现在的样子。 Please let me know if there any other information that I can furnish. 如果可以提供其他信息,请告诉我。 The issue occurs after I add the last line in the dependencies. 我在依赖项中添加最后一行后,就会发生此问题。 I have tried adding google-play-services:8.4.0 which fails as well. 我尝试添加google-play-services:8.4.0 ,但也失败了。

I have tried older versions such as 8.1.0 also. 我也尝试过旧版本,例如8.1.0 Any suggestions welcome. 任何建议欢迎。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 16
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.devpactapp"
        minSdkVersion 15
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    repositories {
        flatDir {
            dirs 'aars'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.google.guava:guava:18.0'
    compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@jar'
    compile 'com.microsoft.azure.android:azure-storage-android:0.6.0@aar'
    compile 'com.google.android.gms:play-services-location:8.4.0'
}

Here is the error log: 这是错误日志:

/Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.4.0/res/layout-v21/place_autocomplete_fragment.xml
Error:(18, 29) No resource found that matches the given name (at 'background' with value '?android:attr/selectableItemBackgroundBorderless').
Error:(49, 29) No resource found that matches the given name (at 'background' with value '?android:attr/selectableItemBackgroundBorderless').
/Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.4.0/res/layout/place_autocomplete_item_powered_by_google.xml
Error:(8) No resource identifier found for attribute 'layout_marginStart' in package 'android'
Error:(28) No resource identifier found for attribute 'layout_toEndOf' in package 'android'
Error:(28) No resource identifier found for attribute 'layout_marginStart' in package 'android'
/Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.4.0/res/layout/place_autocomplete_item_prediction.xml
Error:(8) No resource identifier found for attribute 'layout_alignParentStart' in package 'android'
Error:(35) No resource identifier found for attribute 'layout_toEndOf' in package 'android'
Error:(52) No resource identifier found for attribute 'layout_toEndOf' in package 'android'
/Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.4.0/res/layout/place_autocomplete_progress.xml
Error:(2) No resource identifier found for attribute 'indeterminateTint' in package 'android'
Error:(2) No resource identifier found for attribute 'indeterminateTintMode' in package 'android'
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /Users/Debosmit/Library/Android/sdk/build-tools/19.1.0/aapt package -f --no-crunch -I /Users/Debosmit/Library/Android/sdk/platforms/android-16/android.jar -M /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug -A /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/assets/debug -m -J /Users/Debosmit/Documents/Workspace/devpact/app/build/generated/source/r/debug -F /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.example.devpact -0 apk --output-text-symbols /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/symbols/debug
  Error Code:
    1
  Output:
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout-v21/place_autocomplete_fragment.xml:11: error: Error: No resource found that matches the given name (at 'background' with value '?android:attr/selectableItemBackgroundBorderless').
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout-v21/place_autocomplete_fragment.xml:42: error: Error: No resource found that matches the given name (at 'background' with value '?android:attr/selectableItemBackgroundBorderless').
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_item_powered_by_google.xml:8: error: No resource identifier found for attribute 'layout_marginStart' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_item_powered_by_google.xml:28: error: No resource identifier found for attribute 'layout_toEndOf' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_item_powered_by_google.xml:28: error: No resource identifier found for attribute 'layout_marginStart' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_item_prediction.xml:8: error: No resource identifier found for attribute 'layout_alignParentStart' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_item_prediction.xml:35: error: No resource identifier found for attribute 'layout_toEndOf' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_item_prediction.xml:52: error: No resource identifier found for attribute 'layout_toEndOf' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_progress.xml:2: error: No resource identifier found for attribute 'indeterminateTint' in package 'android'
    /Users/Debosmit/Documents/Workspace/devpact/app/build/intermediates/res/debug/layout/place_autocomplete_progress.xml:2: error: No resource identifier found for attribute 'indeterminateTintMode' in package 'android'

The issue was with the compileSdkVersion. 问题出在compileSdkVersion。 Changing that to 23 (the latest) seemed to do the trick. 将其更改为23(最新)似乎可以解决问题。

Not connected to the above issue, I also changed the targetSdkVersion to 23 (latest) as targeting devices that have API level less than that didn't quite make sense. 与上述问题无关,我还将targetSdkVersion更改为23(最新),因为其API级别低于该级别的定向设备没有任何意义。

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

相关问题 找不到Google Play服务资源 - Google play services resource not found 将依赖项添加到gradle后找不到资源 - No resource found after adding dependency to gradle Google Play服务依赖项 - Google Play Services Dependency 添加编译“ com.google.android.gms:play-services:3.1。+”后,在包中没有找到属性“ adSize”的资源标识符 - Getting No resource identifier found for attribute 'adSize' in package right after adding compile “com.google.android.gms:play-services:3.1.+” ADT更新后找不到Google Play服务 - Google Play Services not found after ADT Update 在依赖项列表中找到2个版本的google-play-services.jar - Found 2 versions of google-play-services.jar in the dependency list 找不到资源 - Google Play 服务版本 - 旧 Android 项目 - No Resource found - Google Play Services version - Old Android Project Android:找不到Admob资源@ integer / google_play_services_version - Android: Admob resource not found @integer/google_play_services_version 添加模块依赖项“ com.google.android.gms:play-services-location:16.0.0”后,Android Manifest合并失败。 - Android Manifest merger failed after adding module dependency 'com.google.android.gms:play-services-location:16.0.0'" 添加Google Maps依赖关系后R(资源)文件为红色 - R (resource) file red after adding in google maps dependency
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM