安卓的AdMob和Maven [英] Android AdMob and Maven
问题描述
我有一个Android项目,我需要从同一个来源构建多个版本的同一应用程序。
I have an Android Project where I need to build multiple versions of the same application from the same sources.
要做到这一点,我用的是 Android插件Maven的
To do this, I use the android plugin for Maven
每个版本必须能够包括AdMob的广告。所以在我的POM我说这扶养
Each version must be able to include ads from admob. So in my POM I added this dependancy
<dependency>
<groupId>com.admob.android</groupId>
<artifactId>ads</artifactId>
<version>20101109-ANDROID-3312276cc1406347</version>
<scope>system</scope>
<systemPath>THE_PATH\libs\admob-sdk-android.jar</systemPath>
</dependency>
我不明白在生成时的任何错误,但是,当我执行的应用程序,我得到这个例外
I don't get any errors at build time but, when I execute the application I get this exception
java.lang.ClassNotFoundException: com.admob.android.ads.AdView
因此很明显,包不包括正确?
So apparently the package is not properly included ?
推荐答案
您无法使用系统范围内所需的运行时库。部署JAR到本地存储库或存储库服务器(使用如 MVN安装:installFile 从相关性的声明。),并删除范围和Systempath下。
You can NOT use system scope for runtime required libraries. Deploy the jar into your local repository or your repository server (using e.g. mvn install:installFile ..) and remove scope and systemPath from the dependency declaration.
更新:作为最新版本我 Maven的Android SDK中部署能做到从SDK的AdMob的罐子的安装到你的本地仓库或存储库服务器。
Update: As of the latest releases my Maven Android SDK Deployer can do the install of the AdMob jar from the SDK into your local Maven repository or repository server for you.
这篇关于安卓的AdMob和Maven的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!