Including Google AdMob SDK to use with Ant?

Unfortunately, this isn't easy to do, due to the way jars are processed in main_rules.xml.

Up vote 3 down vote favorite share g+ share fb share tw.

AdMob SDK using instructions on this Google site. We are supposed to integrate the GoogleAdMobAdsSdk-4.0.4. Jar file into our project.

Problem is: how do we do this using Ant? I works fine in Eclipse (it goes automatically into the . Classpath file), but with Ant it throws a lot of "cannot find" problems when ant releaseing.

Where and how do I include the reference to that jar? I suspect I should do it in build. Xml, but I'm not sure how.

I copy the source folder elsewhere so it won't mess with my eclipse project folder. // edited: Let me be more specific: it works automatically if I just put the jar into libs folder, but I wanted to know if I could use the jar if the jar is located somewhere else. Anyway, my problem is solved... I can compile putting it into libs.

I will take this as a curiosity question. No rush. Here is .

Classpath file, below. Let me say it only makes a difference in Eclipse, but Ant does not seem to use it: Ant error: compile: javac C:\android-sdk-windows\tools\ant\main_rules. Xml:384: warning: 'includeantruntime' was not set, defaulting to build.

Sysclasspath=last; set to false for repeatable builds javac Compiling 35 source files to C:\Users\David\Documents\program\eclipse\MyApp\9-branch\aaa\bin\classes javac C:\Users\David\Documents\program\eclipse\MyApp\9-branch\v9\src\net\myapp\ui\MainActivity. Java:116: package com.google. Ads does not exist javac import com.google.ads.

*; javac ^ javac C:\Users\David\Documents\program\eclipse\MyApp\9-branch\v9\src\net\myapp\ui\MainActivity. Java:143: cannot find symbol javac symbol : class AdView javac location: class net.myapp.ui. MainActivity javac AdView adView; javac ^ I've tried looking into main_rules, and I can see where it declares the libs folder as a place for jars, but still, I wondering if there is a simple way, per-project line of code to customize this.

Thanks. Android ant jar admob link|improve this question edited Apr 28 '11 at 2:02 asked Apr 28 '11 at 1:14David2,4221926 93% accept rate.

1 Can you edit the . Classpath and ant errors into the question? Is it only release builds, or does this hit the debug target too?

– Phil Lello Apr 28 '11 at 1:34 Thanks for the response. I included the proper details. Anyway, let me repeat that I solved this putting it into libs, so for now I can live with that.

But as I said, I wanted to use only one jar to various projects (no need to put one into each project libs folder). – David Apr 28 '11 at 2:03.

Unfortunately, this isn't easy to do, due to the way jars are processed in main_rules. Xml: It looks in one directory, and builds a path from all the files in there. Given that the admob jar has an embedded version number, I'd suggest you stick with keeping a copy in the project libs directory.

If you use SVN, you could use an externals definition to pull the jar into a subdirectory, and using a copy task at -pre-compile to move the latest one into libs; it all depends how many people (or machines) you're sharing the code with I can't think of an elegant way that creates less maintenance than just copying the jar.

Thanks for the clarification. That's the idea I was having, too. Best regards.

– David Apr 29 '11 at 2:35.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions