Android AdMob 和 Maven [英] Android AdMob and Maven

查看:33
本文介绍了Android AdMob 和 Maven的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Android 项目,我需要从相同的来源构建同一应用程序的多个版本.

I have an Android Project where I need to build multiple versions of the same application from the same sources.

为此,我使用 适用于 Maven 的 Android 插件

每个版本都必须能够包含来自 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_PATHlibsadmob-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 install: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 SDKDeployer 可以为您将 SDK 中的 AdMob jar 安装到您的本地 Maven 存储库或存储库服务器中.

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.

这篇关于Android AdMob 和 Maven的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆