我已将meta标记包含在我的清单文件中,并将我的playservices引用到工作区中......可能是什么问题?
07-24 02:41:40.787: E/AndroidRuntime(1427): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. 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" />
07-24 02:41:40.787: E/AndroidRuntime(1427): at com.google.android.gms.common.GooglePlayServicesUtil.x(Unknown Source)
07-24 02:41:40.787: E/AndroidRuntime(1427): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
07-24 02:41:40.787: E/AndroidRuntime(1427): at com.example.gcm.MainActivity.checkPlayServices(MainActivity.java:49)
07-24 02:41:40.787: E/AndroidRuntime(1427): at com.example.gcm.MainActivity.onCreate(MainActivity.java:24)
07-24 02:41:40.787: E/AndroidRuntime(1427): at android.app.Activity.performCreate(Activity.java:5231)
07-24 02:41:40.787: E/AndroidRuntime(1427): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
答案 0 :(得分:0)
在应用程序标记下声明您的元标记: -
<application
android:allowBackup="true"
.................>
<meta-data
android:name="com.google.android.gms.version"
android:value="4452000" />
输入所需的整数或从整数文件中引用它
答案 1 :(得分:0)
您必须在meta-data
标记内添加一个application
标记,如您提供的logcat
所示
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />