"严重异常:主"和"谷歌Play服务的过时&QUOT的;在模拟器 [英] "Fatal Exception: main" and "Google Play services out of date" on emulator

查看:143
本文介绍了"严重异常:主"和"谷歌Play服务的过时&QUOT的;在模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid,我试图开发一个Android应用程序,其中包括谷歌地图。该应用程序是在模拟器上工作正常,直到我决定更新谷歌以9播放从版本7的服务。

I am new to Android and I am trying to develop an android app that includes Google maps. The app was working fine on the emulator until I decided to update the Google Play services from revision 7 to 9.

我现在得到我以前也遇到过同样的错误(谷歌播放服务是过时的......),加上一个致命异常:主要的错误。以下是我在logcat中得到:

I now get the same error I encountered before ("Google Play services is out of date..."), plus a "fatal exception: main" error. Here is what I get in the logcat:

http://imageshack.us/a/img11/8117/y1mq.png

如果我正确读取的logcat,误差在MapTabActivity,但我不知道,如果错误是由谷歌播放服务是过时或因如果是别的东西......

If I read the logcat correctly, the error is in the MapTabActivity but I don't know if the error is caused by the Google Play services being out of date or if it's something else...

更新谷歌播放服务之前,应用程序正在模拟器上用

Before updating the Google Play services, the app was working on an emulator with


  • 的Nexus 4设备

  • 的Andr​​oid 4.2.2(API拉特17)

  • ARM CPU

  • 主机GPU选

我也不得不安装com.android.vending.apk和com.google.android.gms.apk被建议在这个其他职位。

I also had to install the com.android.vending.apk and com.google.android.gms.apk that was recommend in other posts about this.

我还添加许可必要到清单并申请了它也包含在清单中的API键

I also added the permission necessary to the manifest and applied for an API key which is also included in the manifest.

谁能帮我?这里的MapTabActivity及其相应的XML。

Can anyone help me? Here's the MapTabActivity and its corresponding XML.

MapTabActivity.java

MapTabActivity.java

package com.dissertation.closethedoordiss;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;

public class MapTabActivity extends FragmentActivity {

private GoogleMap mMap;
private static final LatLng BRISTOL = new LatLng(51.455083,-2.586903);

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maptab);


    mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapView)).getMap();
    mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(BRISTOL, 13));
}

public void onClick_addretailer (View view) {
    startActivity(new Intent("com.closethedoordiss.AddRetailerActivity"));
}  
}

activity_maptab.xml

activity_maptab.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

  <fragment
        android:name="com.google.android.gms.maps.SupportMapFragment" 
        android:id="@+id/mapView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />



  <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:src="@android:drawable/ic_menu_add"
        android:onClick="onClick_addretailer"
        android:contentDescription="@string/add_button" />

</RelativeLayout>

在此先感谢提供任何帮助。

Thanks in advance for any help provided.

推荐答案

我已经找到了运行谷歌Android的地图API V2的唯一办法就是物理设备上。

The only way I have found to run Google Maps Android API v2 is on a physical device.

我正在我在三星Galaxy S二重奏应用与Android 4.0.4和地图正确显示。

I am running my app on a Samsung Galaxy S Duos with Android 4.0.4 and the map is displaying correctly.

尝试了多种解决方案,包括测试几个模拟器配置和安装不同的APK之后,我相信克服谷歌播放服务是过时的最简单的方法,当涉及到使用谷歌地图API V2上的仿真器是问题制定一个物理设备上/测试。

After trying several solutions, including testing several emulator configurations and installing different apks, I believe the easiest way to overcome the "Google Play Services is out of date" issue when it comes to using Google maps API v2 on an emulator is to develop/test on a physical device.

希望这有助于。

这篇关于&QUOT;严重异常:主&QUOT;和&QUOT;谷歌Play服务的过时&QUOT的;在模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆