I've been strugling with this problem about week now. Been searching similar topics about this but still can't resolve my problem.
The Prolem is that when i'm trying to run my program on Polar m600 wear or wear emulator (Android V 7.1.1 and API25) they'r giving me this message "Google Play services out of date. Requires 11011000 but found 10289574".
I've followed the "Getting the Last Known Location" part in the android developer site. (Link for the site https://developer.android.com/training/location/retrieve-current.html#play-services)
Here's my Mainactivity code which i'm using
public class MainActivity extends Activity { private FusedLocationProviderClient mFusedLocationClient; public Location mLastLocation; private TextView mTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() { @Override public void onLayoutInflated(WatchViewStub stub) { mTextView = (TextView) stub.findViewById(R.id.text); } }); mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; } mFusedLocationClient.getLastLocation() .addOnSuccessListener(this, new OnSuccessListener<Location>() { @Override public void onSuccess(Location location) { mLastLocation = location; Log.d("Location is:",""+mLastLocation); if (location != null) { } } }); } }
Here's my manifest.xml`
<uses-feature android:name="android.hardware.type.watch" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@android:style/Theme.DeviceDefault"> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <activity android:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
And last but not least my build.gradle
android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "ims.fhj.at.testnavigators" minSdkVersion 21 targetSdkVersion 25 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.support:wearable:2.0.3' compile 'com.google.android.gms:play-services-wearable:11.0.1' compile 'com.google.android.gms:play-services:11.0.1'}
The app approval in managed Google Play is deprecated as of September 1, 2021, and will be turned off on September 1, 2022. This includes: the following methods of the Google Play EMM API: products.
Create emulator Nexus 5x with Android version O - api 26 - x86 or Android version Nougat - api 24 - x86
Then click on the 3 dots in the emulator and this will open the extanded window, there click on Google Play + update. And that will update Google Play Services to the latest update thats 11.0.55 today.
You have to downgrade the API in wearable gradle file.
The problem is that your device doesn't have up-to-date Google Play Services application.
To fix it change into this:
compile 'com.google.android.gms:play-services-wearable:10.0.0' compile 'com.google.android.gms:play-services:10.0.0'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With