“应用程序将无法运行,除非你更新谷歌播放服务”与谷歌地图API [英] “App won't run unless you update Google Play services” with Google Maps API
问题描述
我创建了谷歌地图API的应用程序。几个小时试图解决错误之后,我successfuly拼命地跑它(不崩溃)。但现在我得到一个错误。
I created an app with Google Maps API. After few hours of trying to resolve errors, I successfuly runned it(without crashes). But now I get a error.
该警报的意思是应用程序将无法运行,除非你更新谷歌播放服务。 我听说有仿真器的错误,但我用真实的设备(LG P350在姜饼)。 我有设备与Android 2.3,所以我用SupportLibrary。
That alert means "App won't run unless you update Google Play services". I heard about that error with emulator, but I'm using real device(LG P350 on Gingerbread). I have got device with android 2.3 so I use SupportLibrary.
我的活动文件
<?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>
和AndroidManifest
And 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>
任何想法?
推荐答案
您已经创下了错误的时间点。
You have hit a wrong point in time.
谷歌播放服务已经更新到4.0.30最近,所以你似乎可以用该版本谷歌播放-services_lib的。基于这一行假设:
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. Assumption based on this line:
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
并非所有设备都已经收到GooglePlayServices.APK,这需要至少相同的版本,您使用的是客户端库的更新。
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.
检查版本GPServices.APK在设置应用程序。对我来说,它仍然是在66年2月3日,也是最后一次我不得不等待数天进行更新。
Check version of GPServices.APK in Settings app. For me it is still at 3.2.66 and last time I had to wait few days for the update.
如果您使用的是摇篮,你可以把低版本的依赖。如果没有,你必须从某处下载谷歌播放,services_lib的旧版本。
If you are using gradle, you can put lower version dependency. If not, you have to download older version of google-play-services_lib from somewhere.
编辑:
或获取谷歌播放服务从Froyo的Android SDK中。它是一样previous释放(65年3月2日)。
or get Google Play Services for Froyo from Android SDK. It is the same as previous release (3.2.65).
这篇关于“应用程序将无法运行,除非你更新谷歌播放服务”与谷歌地图API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!