问题描述
大约一周以来,我一直在努力解决这个问题。一直在搜索与此类似的主题,但仍然无法解决我的问题。
问题是,当我试图在Polar m600 Wear或Wear模拟器上运行程序时(Android V 7.1.1和API25),他们给我的消息是 Google Play服务已过时。需要11011000但找到了10289574。
我关注了android开发人员网站中的获取最后的已知位置部分。 (网站链接
然后在模拟器中单击3个点,这将打开扩展的窗口,然后单击Google Play +更新。然后,这会将Google Play服务更新为今天的11.0.55。
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'}
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.
这篇关于Google Play服务已过时。需要11011000但找到10289574的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!