1

只是试图整合MillennialMedia广告网络以通过我的应用获利。我做了所有必须要做的事情。但它在 logcat 中给了我这个错误(我用谷歌搜索了 1h 并没有找到其他人有这个问题......):

05-25 23:00:14.437: E/MMSDK-MMSDK(29250): Error calling getRealMetrics: java.lang.NoSuchMethodException: getRealMetrics []
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at java.lang.Class.getConstructorOrMethod(Class.java)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at java.lang.Class.getMethod(Class.java)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getMetrics(MMSDK.java:1075)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getDensity(MMSDK.java:742)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getDensityString(MMSDK.java:736)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.insertUrlCommonValues(MMSDK.java:877)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.HandShake$1.run(HandShake.java:333)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
05-25 23:00:14.437: E/MMSDK-MMSDK(29250):   at java.lang.Thread.run(Thread.java)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250): Error calling getRealMetrics: java.lang.NoSuchMethodException: getRealMetrics []
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at java.lang.Class.getConstructorOrMethod(Class.java)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at java.lang.Class.getMethod(Class.java)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getMetrics(MMSDK.java:1075)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getDpiHeight(MMSDK.java:1094)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.insertUrlCommonValues(MMSDK.java:878)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.HandShake$1.run(HandShake.java:333)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
05-25 23:00:14.442: E/MMSDK-MMSDK(29250):   at java.lang.Thread.run(Thread.java)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250): Error calling getRealMetrics: java.lang.NoSuchMethodException: getRealMetrics []
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at java.lang.Class.getConstructorOrMethod(Class.java)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at java.lang.Class.getMethod(Class.java)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getMetrics(MMSDK.java:1075)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.getDpiWidth(MMSDK.java:1065)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.MMSDK.insertUrlCommonValues(MMSDK.java:879)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at com.millennialmedia.android.HandShake$1.run(HandShake.java:333)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
05-25 23:00:14.447: E/MMSDK-MMSDK(29250):   at java.lang.Thread.run(Thread.java)
05-25 23:00:14.447: E/MMSDK-HandShake(29250): Could not get a handshake. : java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at com.google.android.gms.common.GooglePlayServicesUtil.t(Unknown Source)
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at com.millennialmedia.android.MMSDK.insertUrlCommonValues(MMSDK.java:893)
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at com.millennialmedia.android.HandShake$1.run(HandShake.java:333)
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
05-25 23:00:14.447: E/MMSDK-HandShake(29250):   at java.lang.Thread.run(Thread.java)

那是我的 logcat,这是我使用的代码:

MMSDK.initialize(this);

    MMRequest request = new MMRequest();
    interstitial = new MMInterstitial(this);
    interstitial.setMMRequest(request);
    interstitial.setApid("163665");
    interstitial.setListener(new RequestListenerImpl() {
        @Override
        public void requestCompleted(MMAd mmAd) {
           interstitial.display();
        }
    });
    interstitial.fetch();

这就是我的代码,我完全不知道什么是假的。有人可以解释我的错误吗?你会很高兴的。谢谢。

4

3 回答 3

0

对不起,我突然没有这个:

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

    <activity android:name="com.millennialmedia.android.MMActivity"
    android:theme="@android:style/Theme.Translucent.NoTitleBar" 
    android:configChanges="keyboardHidden|orientation|keyboard" ></activity>

在我的清单中所以它没有工作......我不知道为什么,但现在我的应用程序显示广告!就像安迪说的那样,错误仍然存​​在,但如果所有必要的事情都有效……感谢所有人,尤其是提醒我查看清单的 onik!

于 2014-05-26T15:18:18.773 回答
0

对于有这些错误的其他人:

我给客户服务发了电子邮件,他们说错误出现在较新版本的 Android(我认为是 4.4+)上,但它们不会影响广告的加载或显示

于 2014-06-01T16:19:58.147 回答
0

In version 5.2 of Millennial's Android SDK, it reaches methods added in later versions of the Android SDK through introspection and logs out Exceptions to logcat for transparency and debugging purposes.

You may also see similar Exceptions in your logcat for setMediaPlaybackRequiresUserGesture or setLayerType depending on the version of the Android SDK being compiled against and the actual handset's Android version.

Anyway, all of these are handled exceptions: They won't crash any apps or upset any crash reporting services. And, despite the volume and noise, they don't affect user experience.

There have been more than a handful of e-mails pointing this out, we're taking the hint and making some changes for 5.3.

If anyone needs more information, throw feel free to contact Millennial here-- https://tools.mmedia.com/user/supportDevPortal

于 2014-06-09T19:21:20.223 回答