[英]“App won't run unless you update Google Play services” with Google Maps API
I created an app with Google Maps API. 我使用Google Maps API创建了一个应用。 After few hours of trying to resolve errors, I successfuly runned it(without crashes).
尝试解决错误几个小时后,我成功运行了它(没有崩溃)。 But now I get a error.
但是现在我得到一个错误。
That alert means “App won't run unless you update Google Play services”. 该警报表示“除非您更新Google Play服务,否则应用将无法运行”。 I heard about that error with emulator, but I'm using real device(LG P350 on Gingerbread).
我听说模拟器有此错误,但我使用的是真实设备(姜饼上的LG P350)。 I have got device with android 2.3 so I use SupportLibrary.
我的设备带有android 2.3,因此我使用SupportLibrary。
My activity file 我的活动档案
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Map" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
And AndroidManifest 和AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.secrop.where360"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="io.secorp.where360.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="io.secorp.where360.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_API_KEY"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity
android:name="io.secrop.where360.Map"
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>
</manifest>
Any ideas? 有任何想法吗?
You have hit a wrong point in time. 您打错了时间点。
Google Play Services have been updated to 4.0.30 very recently and so you seem to be using that version of google-play-services_lib. Google Play服务最近已更新到4.0.30,因此您似乎正在使用该版本的google-play-services_lib。 Assumption based on this line:
根据这一行的假设:
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
Not all devices have received an update of GooglePlayServices.APK, which needs to be at least the same version as a client library you are using. 并非所有设备都收到GooglePlayServices.APK的更新,该更新必须至少与您使用的客户端库的版本相同。
Check version of GPServices.APK in Settings app. 在“设置”应用中检查GPServices.APK的版本。 For me it is still at 3.2.66 and last time I had to wait few days for the update.
对我来说,它仍然是3.2.66,上次我不得不等待几天以进行更新。
If you are using gradle, you can put lower version dependency. 如果使用gradle,则可以降低版本依赖性。 If not, you have to download older version of google-play-services_lib from somewhere.
如果不是,则必须从某处下载旧版本的google-play-services_lib。
Edit: 编辑:
or get Google Play Services for Froyo from Android SDK. 或从Android SDK获取Froyo的Google Play服务。 It is the same as previous release (3.2.65).
与以前的版本(3.2.65)相同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.