简体   繁体   中英

Android Studio project with library module google play services error

I'm having this problem that so many devs do:

Error:No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

What's different about my project is the play services dependency comes from a library (that I control) which I've included as an AAR file.

Library

build.gradle: compile 'com.google.android.gms:play-services-base:10.2.1'

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

App project

Top level build file:

repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
    }

The AAR is in the libs directory.

Module build file: compile(name:'app-debug', ext:'aar')

That is the only dependency. I also tried it like this:

compile(name:'app-debug', ext:'aar') {
        transitive = true;
    }

but no change. That was based on this question, which is the closest I've found to my situation, but that person is including the dependency as a maven artifact: Error with google_play_services_version value from aar library

Please let me know if you need to see anything else.

本地aar文件不包含项目的依赖项,因此您应该将库使用的所有依赖项(包括Google位置服务)手动包含到应用程序的build.gradle文件中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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