Yesterday API 19 came out so I upgraded SDK and other (including Google Play Services)
now this method:
private boolean isGooglePlayInstalled(){
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if(status == ConnectionResult.SUCCESS){
return true;
}else{
((Dialog)GooglePlayServicesUtil.getErrorDialog(status, this,10)).show();
}
return false;
}
Throws at line
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" />
How to fix that? I didnt have element
"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>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…