gpt4 book ai didi

android - Google Play 服务已过时。需要 11011000 但找到 10289574

转载 作者:IT老高 更新时间:2023-10-28 22:05:49 25 4
gpt4 key购买 nike

大约一周以来,我一直在努力解决这个问题。一直在搜索类似的主题,但仍然无法解决我的问题。

问题是,当我尝试在 Polar m600 磨损或磨损模拟器(Android V 7.1.1 和 API25)上运行我的程序时,他们给我这条消息“Google Play 服务已过期。需要 11011000 但找到 10289574"。

我已经关注了 android 开发者网站中的“获取最后一个已知位置”部分。 (网站链接https://developer.android.com/training/location/retrieve-current.html#play-services)

这是我正在使用的 Mainactivity 代码

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

}
}
});

}
}

这是我的 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>

最后但并非最不重要的是我的 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'}

最佳答案

使用 Android 版本 O - api 26 - x86 或 Android 版本 Nougat - api 24 - x86 创建模拟器 Nexus 5x Nexus 5x

enter image description here

然后点击模拟器中的 3 个点,这将打开扩展窗口,点击 Google Play + 更新。这会将 Google Play 服务更新到今天 11.0.55 的最新更新。

enter image description here

关于android - Google Play 服务已过时。需要 11011000 但找到 10289574,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44584698/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com