android-谷歌播放服务广告-无法实例化以下类:com.google.android.gms.ads.AdView

android-谷歌播放服务广告-无法实例化以下类:com.google.android.gms.ads.AdView,android,eclipse,google-play-services,Android,Eclipse,Google Play Services,我刚刚清理安装的Android开发工具(ADT),我很难让Google Play服务正常工作;更具体地说,我无法通过布局预览来实例化adView横幅 将最新的GPS库导入我的工作区(从sdk/extras/Google/Google play services复制到工作区) 右键单击项目>属性>android选项卡>将GPS库添加到项目 将以下内容添加到我的项目清单中: 外部 在图形布局窗格中,我得到了错误 The following classes could not be instanti

我刚刚清理安装的Android开发工具(ADT),我很难让Google Play服务正常工作;更具体地说,我无法通过布局预览来实例化adView横幅

将最新的GPS库导入我的工作区(从sdk/extras/Google/Google play services复制到工作区)

右键单击项目>属性>android选项卡>将GPS库添加到项目

将以下内容添加到我的项目清单中:

外部

在图形布局窗格中,我得到了错误

The following classes could not be instantiated:
- com.google.android.gms.ads.AdView
我忘了什么吗?我在什么地方出错了吗?有人对如何解决此问题有任何想法>


谢谢

这是我的临时工作。我将Google Play Services SDK的版本从5.x降级为4.x。我将Intellij Community 13.x与Gradle一起使用,因此我的依赖项部分现在如下所示:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile 'com.google.android.gms:play-services:4.+'
}

同样,这只是暂时的,让我能够完成构建XML布局文件。我计划在进入最后测试阶段时升级到最新版本5.x。我已经向谷歌AdMob广告开发者论坛提交了关于这个问题的问题,希望引起别人的注意。我还没有找到为此特定SDK提交错误报告的方法,但我仍在寻找。

另请注意:在我的android设备上运行应用程序时,广告效果良好;只有预览无法正常工作
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >


<com.google.android.gms.ads.AdView android:id="@+id/adView"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     ads:adUnitId="my ad id as stated on apps.admob.com"
                     ads:adSize="BANNER"/>
The following classes could not be instantiated:
- com.google.android.gms.ads.AdView
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile 'com.google.android.gms:play-services:4.+'
}