简体   繁体   中英

No Gradle - No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version')

I'm using Android Studio IDE and i keep getting this error after adding the google play services library. Keep in mind this is using a project that is Eclipse based and we don't have any gradle files.

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

First let me say how I added the library…

I located my android SDK folder, then find the google-play-services-jar and then i just copied it to my /libs folder. Then I went under...

File > Project Structure > Libraries > + added the google-play-services.jar

Now its listed under this, but I keep getting the above error in my manifest on line…

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

I've tried searching high and low on what to do, but nothing is working for me. Also when I go under File > Project Structure > Modules > + Module Dependency it just says there is none.

The Play Services SDK is an Android library project, not a JAR, which is why the version resource is not available to you. Undo all the stuff you did above, then add the following line to the dependencies closure in your module's build.gradle file (eg, app/build.gradle ):

compile 'com.google.android.gms:play-services:7.0.0'

Or, for a faster build and smaller APK, choose more focused dependencies , for whatever bit(s) of the Play Services SDK that you need.

You can read more about this process in the documentation .


UPDATE

Apparently, somehow, this project is using the IntelliJ IDEA build system directly, which means that you will have to follow other advice for getting the Play Services SDK into IDEA . That being said, I would really recommend moving over to Gradle, as I would not count on necessarily being able to use the IDEA build system in Android Studio directly over the long haul.

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