I’ve been trying for ages to get AdMob Ads to appear in my app. I followed the AdMob PDF instructions and am stuck at this point: Eclipse, when displaying my main layout XML file in “Graphical Layout” mode, tells me: “The following classes could not be found: – com.admob.android.ads.AdView”.
I presumed it had to to with the build path, but from what I can tell the admob…jar file is correctly added as JAR file to the build path for the project and appears under “Referenced Libraries” in the Package Explorer tree of Eclipse.
in the bin folder, however, these classes are not included (should they be?).
Any ideas on how to get eclipse, and the application for that matter, to find these classes?
EDIT: It turns out I get this message on and off for no apparent reason. Playing around with the main XML layout file (the code related to the admob ad) and saving it seems to make the message appear or disappear. However, I don’t think it was responsible for the ad not showing. Just make sure the emulator has internet access (not obvious if using WiFi under Linux) and that the layout/positioning is correct.
I’ve passed through the same errors, and Nishan’s answer was just part of the solution for me.
Don’t know if your using a lib with your full app to provide two versions (A free/add supported and a paid one) of your app, each one with a separated project, but both including the app lib.
If this is the case, I solved it by importing the AdMob lib from each of the two main projects, and not from the original app lib. And you need to make sure you select ADD EXTERNAL JAR at Build
Path Configuratiom, and not just ADD JAR.