2015-04-04 37 views
0

我得到了关于谷歌的AdMob一个问题:的AdMob仍然没有工作

我试图显示间质性,为了这个,我已经添加了AdActivity,权限和元标记来体现。

清单:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.lunation.warface" 
android:versionCode="10" 
android:versionName="1.4" > 

<uses-sdk 
    android:minSdkVersion="13" 
    android:targetSdkVersion="19" /> 

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

<application 
    android:allowBackup="true" 
    android:icon="@drawable/icon" 
    android:label="@string/app_name" 
    android:largeHeap="true" 
    android:theme="@style/AppTheme" 
    android:windowSoftInputMode="adjustPan|adjustResize" > 

    <!--This meta-data tag is required to use Google Play Services.--> 
    <meta-data android:name="com.google.android.gms.version" 
    android:value="@integer/google_play_services_version" /> 
    <!--Include the AdActivity configChanges and theme. --> 
    <activity android:name="com.google.android.gms.ads.AdActivity" 
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" 
     android:theme="@android:style/Theme.Translucent" /> 
    <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name" 
     android:screenOrientation="sensorPortrait" 
     android:windowSoftInputMode="adjustPan|adjustResize" > 
     <intent-filter> 
     </intent-filter> 
    </activity> 

    <activity 
     android:name=".SplashScreen" 
     android:noHistory="true" 
     android:screenOrientation="sensorPortrait" 
     android:theme="@style/Theme.Transparent" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" > 
      </action> 

      <category android:name="android.intent.category.LAUNCHER" > 
      </category> 
     </intent-filter> 
    </activity> 

    <activity android:name="gallery.FullScreenViewActivity"></activity> 





    </application> 

</manifest> 

在MainActivity:

mInterstitialAd = new InterstitialAd(this); 

mInterstitialAd.setAdUnitId("xxx/xxx"); 

AdRequest adRequest = new AdRequest.Builder().build(); 
mInterstitialAd.loadAd(adRequest); 

if (mInterstitialAd != null && mInterstitialAd.isLoaded()) { 
    mInterstitialAd.show(); 
} 

的logcat:

04-04 15:15:19.397: W/Ads(19752): There was a problem getting an ad   response. ErrorCode: 0 
04-04 15:15:19.407: I/dalvikvm(19752): Could not find method  android.webkit.WebSettings.setMixedContentMode, referenced from method  com.google.android.gms.ads.internal.s.g.<init> 
04-04 15:15:19.407: W/dalvikvm(19752): VFY: unable to resolve virtual  method 3153: Landroid/webkit/WebSettings;.setMixedContentMode (I)V 
04-04 15:15:19.407: D/dalvikvm(19752): VFY: replacing opcode 0x6e at 0x004a 

04-04 15:15:19.502: W/Ads(19752): Failed to load ad: 0 

此外还有一个编译错误:

达尔文格式转换失败,错误代码为1

我试过20个答案,仍然无法正常工作。

我也是不知道问题是否是单位的ID,我可以改变

mInterstitialAd.setAdUnitId("xxx/xxx"); 

到:

mInterstitialAd.setAdUnitId("xxx"); 

,我得到了同样的错误。

我用下面的外部库: 支持Android V4 & V7,毕加索,ftpclient(公共,httpmime),FAB

是否有人有意见吗?

问候

+0

发布您的'build.gradle'。 – 2015-04-04 14:10:18

+0

我有Eclipse,所以我没有build.gradle文件): – 2015-04-04 14:14:23

+0

那么,它会更加困难。除了“未能加载广告错误”,您怎么会得到编译错误。后者会阻止你运行该应用程序。 – 2015-04-04 14:18:06

回答

0

找到解决方案!

看起来像CyanogenMod块AdMob中的一些功能。 在没有Adaware和阻止工具的情况下闪过新版本。

现在工作:D

相关问题