gpt4 book ai didi

android - 谷歌播放服务更新

转载 作者:IT王子 更新时间:2023-10-28 23:56:14 26 4
gpt4 key购买 nike

昨天 API 19 出来了,所以我升级了 SDK 和其他(包括 Google Play 服务)现在这个方法:

private boolean isGooglePlayInstalled(){
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if(status == ConnectionResult.SUCCESS){
return true;
}else{
((Dialog)GooglePlayServicesUtil.getErrorDialog(status, this,10)).show();
}
return false;
}

在行中抛出

int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

Caused by: java.lang.IllegalStateException: The meta-data tag in your app's 
AndroidManifest.xml does not have the right value. Expected 4030500 but found 0.
You must have the following declaration within the <application> element:
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

如何解决这个问题?我没有元素

"com.google.android.gms.version"
in manifest before and it worked.

This is my manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sabatsoft.driveit"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="com.sabatsoft.driveit.activity.Start"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- other activities -->

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIza*********************************1MZI" />
</application>

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

</manifest>

最佳答案

这对我有用:

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

将此放置在 list 的末尾,在 Map API key 元数据标记之后。由于您在 onCreate 方法中检查 GPlayServices 的可用性,例如:

// Check status of Google Play Services
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

// Check Google Play Service Available
try {
if (status != ConnectionResult.SUCCESS) {
GooglePlayServicesUtil.getErrorDialog(status, this, RQS_GooglePlayServices).show();
}
} catch (Exception e) {
Log.e("Error: GooglePlayServiceUtil: ", "" + e);
}

...然后,一旦您单击对话框更新 GPlayServices,您将被带到 GPlayStore。通常,我从 GPlayStore 菜单中卸载,然后可以使用更新选项。之后它应该可以工作了。

关于android - 谷歌播放服务更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19724113/

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