Question

I am trying to implement Admob in my Android app.I found the way to add google play services from sdk>extras>google_play_services.I have imported into my workspace but I cant able to add it my project.The selection of project is not highlighted.

Can anyone help me?

Was it helpful?

Solution

When you have imported your Google_play_services_lib in your project you have to enable your "Copy to WorkSpace" checkbox. So you can find that library project in Eclipse. After that you have to go to

Right click on project -> Go to properties -> Click on Android from left bar -> Add Library -> Click there you will find google_play_service_lib -> Click Apply and ok.

So it will be added as a library project to your project.

Second option is that you can import GoogleAdMobAdsSdk-6.4.1.jar jar file into your libs folder.

OTHER TIPS

Follow below steps:

-> Right click on project -> Go to properties -> Click on Android from left bar -> Scroll down you will see Add Library options there -> Click there you will find google_play_service_lib -> Click Apply and ok.

Answered in here:

Import project with no .project file

Just create a new project with the existing source file, then choose the google-play-services-lib files you copied to your workspace from the Android SDK folder as explained in here:

https://developer.android.com/google/play-services/setup.html

I just found the solution. This worked for me.

After import google-play-services_lib to your workspace, go to this project and look for project.properties

and this line at the end: android.library=true

For Example:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-20
android.library=true
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top