0

My application works correctly, when i have installed Google Play Services, but without it, application stop when i open it. It's clear, but when i add the method which checks whether Google Play Services is available on device and when is not, it should display error dialog, but it. Application don't open, too.

This is code which i copy from other post. I tried do this by my code, but it doesn't work, too.

The method:

public void checkGooglePlayServicesAvailability()
      {
          int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
          if(resultCode != ConnectionResult.SUCCESS)
          {
              Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 1);
              dialog.setCancelable(false);
              dialog.show();
          }

          Log.d("GooglePlayServicesUtil Check", "Result is: " + resultCode);
      }

call in onResume():

@Override
    protected void onResume()
    {
          checkGooglePlayServicesAvailability();

          super.onResume();
    }

I have installed Google Maps, too. Maybe someone can help me?

Edit: LogCat:

07-07 15:33:39.150: E/Trace(3448): error opening trace file: No such file or directory (2)
07-07 15:33:41.361: E/Google Maps Android API(3448): Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
07-07 15:43:15.820: E/Google Maps Android API(3524): Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
07-07 16:06:55.349: E/Trace(3615): error opening trace file: No such file or directory (2)
07-07 16:06:57.841: E/Google Maps Android API(3615): Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
user2511941
  • 161
  • 1
  • 5
  • 14

2 Answers2

0

Your super.onResume(); should be called before you invoke other methods

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
0

I think your problem is that the device you are trying to use doesn't support the OpenGL ES 2.0 feature. Try using a device that supports the feature.

Emmanuel
  • 13,083
  • 4
  • 39
  • 53
  • I think it can't be. I wrote that when i downloaded google play service from link of other application, then my application works fine. – user2511941 Jul 07 '13 at 17:19
  • The stacktrace is telling you that the feature is not supported on the current device. Did you manage to run your app on this same device or you had to use another device? What device are you using? – Emmanuel Jul 07 '13 at 17:22
  • I'm using another device - HTC Wildfire S with android 2.3.3 – user2511941 Jul 07 '13 at 17:28
  • What was the original device? – Emmanuel Jul 07 '13 at 17:29
  • Orginal(emulator) was some device with android 4.2.2 – user2511941 Jul 07 '13 at 17:31
  • OpenGL ES 2.0 is not supported by the HTC wildfire s. Try another device. Look at this link http://stackoverflow.com/questions/7020324/what-version-of-opengl-does-htc-wildfire-support – Emmanuel Jul 07 '13 at 17:35
  • Ok, but why i can download google play services from other application and there's google maps too nad by mine i can't do this? – user2511941 Jul 07 '13 at 17:42
  • I think you can still download Google play, but since Google Maps V2 requires OpenGL ES 2.0 it won't run. Maybe the obsolete Google Maps API works... – Emmanuel Jul 07 '13 at 17:49
  • But when on my device google play services is installed, then my application can be run and works fine on my htc wildfire s. I just want to know why error dialog is not displayed. – user2511941 Jul 07 '13 at 17:52