android - LogCat中的Google Ads_Error

标签 android intellij-idea compiler-errors logcat

我要添加我的项目android Google广告。他完成了所有的example操作。我添加了所有库,如此处所述。但是在编译并尝试在手机上启动应用程序后,我不清楚调试器中的问题(IDE-Intellij Idea)。

我添加了manifect:

        <meta-data android:name="com.google.android.gms.version"
         android:value="17"/>


<activity android:name="com.google.android.gms.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
          android:theme="@android:style/Theme.Translucent" />

我在主类中添加(onCreate):
 AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);


import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

在.xml中:
xmlns:ads="http://schemas.android.com/apk/com.dd_pc.service.ServiceActivity"

  <com.google.android.gms.ads.AdView
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            ads:adSize="BANNER"
            ads:adUnitId="@string/banner_ad_unit_id">
    </com.google.android.gms.ads.AdView>

这是link(github)中的日志错误。

最佳答案

根据错误日志,您需要将Google Play服务库导入到您的项目中。

您可以找到here指令,并且由于使用的是Intellij Idea,因此here是可能有用的特定指令。

关于android - LogCat中的Google Ads_Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31716363/

相关文章:

java - 如何在 eclipse adt 上下载额外的 android SDK

java - 找不到符号 Integer.valueOf(int)

java - Java编译中错误的意外顺序

compiler-construction - lex 使用来自 lex.yy.c 文件的 flex -gettin 输出

android - 在通话过程中播放闹钟

android - 蓝色全息颜色在设备上显示为绿色

android - Macintosh 安装适用于 Android 的 HAXM

intellij-idea - 无法在intellij中设置断点

docker - VSCode/Intellij 中 docker 容器中 Tomcat/Wildfly 服务器的远程调试

java - ArrayList运行时错误