1

When you try to add AdMob to an Android 1.6(Level4) you get the message:

Could not find method android.view.Display.getRealMetrics, referenced from method com.google.android.gms.ads.internal.util.client.zza.zzT.

SDK 1.6 doesn't have a getRealMetrics() method in android.view.Display. They expect to detect the level and add the methods to be able to run:

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

Is this a bug in google-play-services_lib?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
  • Google Play Services is not compatible with Android 1.6, it only supports Android 2.3 and up. – Mdlc Oct 30 '15 at 14:02

1 Answers1

1

According to this link: https://developers.google.com/android/guides/setup

To test your app when using the Google Play services SDK, you must use either:

*A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.

*The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

I hope this will help you.

Community
  • 1
  • 1
Oğuzhan Döngül
  • 7,856
  • 4
  • 38
  • 52
  • I understand to update the old Android 1.6(API level 4 Donut) app I must rebuilt them with Android 2.3(API level 9 Gingerbread) Project-->Properties-->Android-->Android 2.3(Level 9), to force users to update their phone at least Android 2.3(API level 9 Gingerbread). I suppose to put in Manifest android:minSdkVersion="9" and android:targetSdkVersion="9". At this moment old users of Android 1.6(API level 4 Donut) will not be able to see the AdMob on their phone. – Adrian Dibu Oct 30 '15 at 19:56
  • @AdrianDibu, I will ask you a very important question. How many users do you have which are using Android 1.6? There is no point to use 1.6 today. There is no phone currently selling under 2.3 for years... Devices which are using under api level 8 is less then 0.1%. I have not seen any 1.6 devices for 5 years. Check this: http://developer.android.com/about/dashboards/index.html. 1.6 is not supporting by google anymore. You should'nt support it either. – Oğuzhan Döngül Oct 30 '15 at 20:04
  • I changed to Project-->Properties-->Android-->Android 2.3.1(Level 9) and I have error in Manifest android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" About users for app Body Status I have 22,137 users, Body Balance 3,692, Pedometer Extender 5,654. – Adrian Dibu Oct 30 '15 at 20:35
  • @AdrianDibu, screenSize & smallestScreenSize attributes are available after API level 13. Check this: http://stackoverflow.com/questions/11208729/error-string-types-not-allowed-at-androidconfigchanges-in-manifest-file And the numbers of users; I asked you about active Android 1.6 users, not all of them. You can check the numbers of users according to their OS version. – Oğuzhan Döngül Oct 30 '15 at 20:45
  • android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" – Adrian Dibu Oct 30 '15 at 21:17
  • With android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" I have instead of banner error message that is missing cofigChanges. Android 1.6 0 users in the apps mentioned they start from 2.3. So I used Project-->Properties-->Android-->Android 3.2(Level 13), – Adrian Dibu Oct 30 '15 at 21:24
  • My problem was to update with AdMob 1.6(API level 4 Donut). To be approved they forced me to use Google Play Services and rebuilt them with Android 2.3(API level 9 Gingerbread) Project-->Properties-->Android-->Android 2.3(Level 9) and in Manifest android:minSdkVersion="9" I have a error in xml Manifest related to android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize'".I changed it to android:configChanges="keyboard|keyboardHidden|orientation" to work – Adrian Dibu Oct 31 '15 at 13:17
  • Contenue android:configChanges="keyboard|keyboardHidden|orientation" to work but instead of banner I have an error that I must add android:configChanges.So I changed android:minSdkVersion="13" and it works. I am very sad from Android level 4 I ended to level 13 it is a lot of missing phones. To conclude Google Play Services works only if android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize'". android:minSdkVersion="13".not android:minSdkVersion="9" how they recomanded. – Adrian Dibu Oct 31 '15 at 13:19