转换为新的admob google广告后,com.google.android.gms的内部例外情况

时间:2014-11-25 19:22:52

标签: android exception admob google-play-services

我从我的应用程序谷歌播放中获得以下例外(在去混淆之后):

java.lang.NoSuchMethodError: java.io.IOException.<init>
at com.google.android.gms.internal.et.e(Unknown Source)
at com.google.android.gms.internal.et.b(Unknown Source)
at com.google.android.gms.internal.dx.void co()(Unknown Source)
                                      void b(long)
                                      com.google.android.gms.internal.ee a(com.google.android.gms.internal.dx)
at com.google.android.gms.internal.dx.void co()(Unknown Source)
                                      void b(long)
                                      com.google.android.gms.internal.ee a(com.google.android.gms.internal.dx)
at com.google.android.gms.internal.fm$a$a.com.google.android.gms.internal.fk b(com.google.android.gms.internal.fi)(Unknown Source)
at com.google.android.gms.internal.an.void aV()(Unknown Source)
                                      com.google.android.gms.internal.an$a a(android.view.View,com.google.android.gms.internal.ak)
at com.google.android.gms.internal.br$a.run(Unknown Source)
at com.google.android.gms.internal.bs$a.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1096)

java.lang.NullPointerException
at com.google.android.gms.internal.fm$a$a.com.google.android.gms.internal.fk b(com.google.android.gms.internal.fi)(Unknown Source)
at com.google.android.gms.internal.an.void aV()(Unknown Source)
                                      com.google.android.gms.internal.an$a a(android.view.View,com.google.android.gms.internal.ak)
at com.google.android.gms.internal.br$a.run(Unknown Source)
at com.google.android.gms.internal.bs$a.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)

我正在使用admob并且没有崩溃,但是由于最新的admob要求切换到广告的谷歌播放服务我有崩溃的音调。我正在使用proguard所以问题不在于混淆。在潜入谷歌代码之前,希望有人已经做了一些研究并知道我应该在哪里看。没想到谷歌的这个,仍然希望这是我错过的东西,所以我可以解决它并继续使用admob。

修改 我通过以下方式使用横幅和插页式广告:

private void prepareAdBanner() {
    try {
      RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
      params.addRule(RelativeLayout.CENTER_HORIZONTAL);

      mAdView = new AdView(this);
      mAdView.setAdSize(AdSize.BANNER);
      mAdView.setAdUnitId(ADMOB_BANNER_ID);
      mAdView.setLayoutParams(params);

      ViewGroup layout = (ViewGroup) findViewById(R.id.banner_layout);
      layout.addView(mAdView);

      AdRequest adRequest = new AdRequest.Builder()
          //.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
          //.addTestDevice(DeviceInfo.getInstance().getDeviceId())
          .build();

      mAdView.loadAd(adRequest);

    }catch (Exception e){
      LLog.e("Failed to load banner", e);
    }

private void prepareInterstitial() {
    try {
      mInterstitial = new InterstitialAd(this);
      mInterstitial.setAdUnitId(ADMOB_INTERSTITIAL_ID);
      mInterstitial.setAdListener(new AdListener() {
        @Override
        public void onAdClosed() {
          super.onAdClosed();
          goToMainActivity();
        }
      });

      AdRequest adRequest = new AdRequest.Builder()
          //.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
          //.addTestDevice(DeviceInfo.getInstance().getDeviceId())
          .build();

      mInterstitial.loadAd(adRequest);
    }catch (Exception e){
      LLog.e("Failed to load interstisial", e);
    }
  }

1 个答案:

答案 0 :(得分:0)

我不确定,但我认为我找到了解决问题的方法。将仔细检查并更新答案或删除问题。

这里至少可以解释一个例外: NoSuchMethodError com.google.android.gms.internal.g.f

使用不支持此版本的Google Play服务时,我的最低SDK为2.2。我没有使用旧的API的Froyo谷歌播放版本。