簡體   English   中英

在將Google Play服務位置添加為依賴關系后找不到資源標識符

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

這是我的build.gradle文件現在的樣子。 如果可以提供其他信息,請告訴我。 我在依賴項中添加最后一行后,就會發生此問題。 我嘗試添加google-play-services:8.4.0 ,但也失敗了。

我也嘗試過舊版本,例如8.1.0 任何建議歡迎。

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'
}

這是錯誤日志:

/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'

問題出在compileSdkVersion。 將其更改為23(最新)似乎可以解決問題。

與上述問題無關,我還將targetSdkVersion更改為23(最新),因為其API級別低於該級別的定向設備沒有任何意義。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM