1

Just trying to integrate the MillennialMedia ad network to monetize my app. I did everything like it has to be. But it gives me this error in logcat (I googled like 1h and didn´t find anyone else with this problem...):

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)

That was my logcat, and here comes my code I used:

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();

So thats my code, and I totally don´t know what is false. Could someone explain me my faults? That would be very nice from you. Thanks.

Onik
  • 19,396
  • 14
  • 68
  • 91
user3221178
  • 41
  • 1
  • 3
  • That's what logcat tells you: `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 element: `. Do you have this declaration? – Onik May 25 '14 at 23:18
  • have this problem also in two of my apps. It seems to have started after upgrading to the latest MMedia library. It looks like the MMedia library is trying to call getRealMetrics via Introspection and is failing due to the method not longer existing or having the incorrect signature. The ads are still being displayed though. – Code Rebel May 26 '14 at 02:49
  • Yes, I have this meta data value. @andy c, how did you solve the problem? Because i want to integrate the app, but i cant get a working request. Do i normally get any testadd when my app isnt prooved already? – user3221178 May 26 '14 at 14:59
  • I haven't been able to solve the problem, The ads still seem to work just fine but the logs are full of these errors. – Code Rebel May 28 '14 at 07:27

3 Answers3

0

Sorry guys, i suddenly don´t had this:

<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>

in my manifest so it didnt worked... I don´t know why, but now my app displays ads! The error is still there like andy said, but if all the necessary things work... Thanks to all especially to onik who reminded me looking into my manifest!

user3221178
  • 41
  • 1
  • 3
0

For anyone else who has these errors:

I emailed customer service and they that that the errors show up on newer versions of Android (4.4+ i think) but they dont affect the ads from loading or displaying

Shmuel
  • 3,916
  • 2
  • 27
  • 45
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

  • 5.3 still shows all the mention exceptions in the log. Also interstitial ads don't show on certain Android 5.0 (Nexus 7, Nexus 7 seems to work). Are you guys aware of this? – Emanuel Moecklin Dec 01 '14 at 17:54