I'm using the (new?) 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 release
ing.
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:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="src" path="/android_licensing"/>
<classpathentry kind="lib" path="C:/Users/David/Documents/program/eclipse/GoogleAdMobAdsSdk-4.0.4.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
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.