error: package com.google.android.gms.ads does not exist

user3070657 picture user3070657 · Dec 5, 2013 · Viewed 24.7k times · Source

My Android app did work well (API 15) untill I wanted to include Google ads. Although google-play-services.jar is in my project library and it contains com.google.android.gms.ads, the debugger comes up with an error: package com.google.android.gms.ads does not exist when using:

import com.google.android.gms.ads.*;

I tried several solutions, but none of them worked. I changed from Android 4.03 API15 to Google API15 but nothing changed. What am I doing wrong?

Answer

user2058839 picture user2058839 · Dec 5, 2013

You must import google-play-services_lib that is located in the folder <android-sdk-directory>/extras/google/google_play_services/libproject/google-play-services_lib and declare it as library of your project.

You will find more informations on Set Up Google Play Services SDK.