Java 应用程序因谷歌地图启动而崩溃

Java 应用程序因谷歌地图启动而崩溃,java,android,google-maps,android-intent,Java,Android,Google Maps,Android Intent,映射活动的Java代码 package com.schweigert.drinkingbuddy; import android.app.Activity; import android.os.Bundle; public class BarMaps extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); s

映射活动的Java代码

package com.schweigert.drinkingbuddy;

import android.app.Activity;
import android.os.Bundle;


public class BarMaps extends Activity {



protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.barmaps);


}
}
XML代码

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/map"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:name="com.google.android.gms.maps.MapFragment" >


</fragment>
当我在我的模拟器上运行我在计算机上设置的代码时,它会显示“除非你更新Google Play服务,否则此应用程序不会运行。但当我在物理设备上运行它时,它会超时,并显示应用程序已停止工作。为什么我的模拟器和物理设备之间的错误如此不同

编辑:


因此,我遇到了一个与不再存在的textview交互的尝试捕获,然后我的清单设置不正确。感谢Shivan的帮助。

使用Android SDK管理器更新您的Android SDK。对于设备上的问题,LogCat告诉了我什么?这是我在galaxy s3上运行LogCat时出现的错误。对于我遇到的延迟,我深表歉意你的
StartingPoint.java
第59行有什么内容?有一些内容是
null
。请检查你的“your_APP.apk”中是否包含google play服务。如果没有,它将无法在你的物理手机上正常工作。
    maps.setOnClickListener(new Button.OnClickListener(){

        @Override
        public void onClick(View v) {


                Intent openMap = new Intent("com.schweigert.drinkingbuddy.BarMaps");
                startActivity(openMap);


        }

    });
package com.schweigert.drinkingbuddy;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.EditText;


public class StartingPoint extends Activity {

double numDrinks;
int counter;
EditText standardDrinks;
Button bacIntent, maps, drinks;
TextView display;
Bundle testBundle;
@Override
protected void onCreate(Bundle testBundle) {
    super.onCreate(testBundle);
    setContentView(R.layout.activity_starting_point);
    counter = 0;
    bacIntent = (Button) findViewById(R.id.bacIntent);
    maps = (Button) findViewById(R.id.Maps);
    drinks = (Button) findViewById(R.id.drinks);


    bacIntent.setOnClickListener(new Button.OnClickListener(){
        @Override
        public void onClick(View v){


            try{
                Intent openBac = new Intent("com.schweigert.drinkingbuddy.BloodAlcoholContent");
                startActivity(openBac);
            }
            catch(Exception e)
            {
                display.setText("my d" + e);
            }
            }



    });

    maps.setOnClickListener(new Button.OnClickListener(){

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            try{
                Intent openMap = new Intent("com.schweigert.drinkingbuddy.MainActivity");
                startActivity(openMap);
            }
            catch(Exception e){
                display.setText("my d"+ e);
            }
        }

    });

    drinks.setOnClickListener(new Button.OnClickListener(){

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            try{
                Intent openDrinkMenu = new Intent("com.schweigert.drinkingbuddy.DrinkType");
                startActivity(openDrinkMenu);
            }
            catch(Exception e){
                display.setText("my d:" + e);
            }
        }

    });


}
}