Android Genymotion只是没有启动GoogleMapsDemo应用程序Eclipse。

Android Genymotion只是没有启动GoogleMapsDemo应用程序Eclipse。,android,eclipse,google-maps,sdk,genymotion,Android,Eclipse,Google Maps,Sdk,Genymotion,我下载了GoogleMapsDemo应用程序的项目,它在Eclipse上没有错误。但在genymotion emulator中,它一直在说,不幸的是,应用程序无法启动 这是我的Android清单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ca.sfu.cmpt276.bfraser"

我下载了GoogleMapsDemo应用程序的项目,它在Eclipse上没有错误。但在genymotion emulator中,它一直在说,不幸的是,应用程序无法启动

这是我的Android清单:

<?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.sfu.cmpt276.bfraser"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="17" />

<permission
    android:name="ca.sfu.cmpt276.bfraser.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>
<uses-permission android:name="ca.sfu.cmpt276.bfraser.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="AIzaSyB1lm4b1b6DEwlROS1KA12Nhfa2IvbgS34"
        />
    <meta-data
            android:name="com.google.android.gms.version"
         android:value="@integer/google_play_services_version"/>

    <activity
        android:name="ca.sfu.cmpt276.bfraser.MainActivity"
        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>
  • 如果您想使用谷歌服务(如谷歌地图),您需要首先为Android设置
    Google Play services
    ,您可以按照说明表单进行操作。(获取自己的API密钥,放入AndroidManifest.xml等)

  • 我建议你用一个真正的设备来测试。如果您想使用
    Genymotion
    作为仿真器,还需要
    首先获得谷歌服务。有关更多详细信息,请参阅


  • 欢迎来到堆栈溢出。请花几分钟读一读。在您的具体案例中,请添加详细的日志输出和错误消息。首先感谢您的回答,但我已经完成了所有这些步骤。我有自己的Api密钥,正如我在代码中提供的一样。我使用Genymotion作为模拟器。在我做了研究之后,我意识到我需要调试指纹。你知道吗@bjiang
    package ca.sfu.cmpt276.bfraser;
    
    import android.app.Activity;
    import android.os.Bundle;
     import android.view.Menu;
    import android.view.View;
    
    import com.google.android.gms.maps.CameraUpdate;
    import com.google.android.gms.maps.CameraUpdateFactory;
    import com.google.android.gms.maps.GoogleMap;
     import com.google.android.gms.maps.MapFragment;
    import com.google.android.gms.maps.model.LatLng;
    import com.google.android.gms.maps.model.MarkerOptions;
    
     public class MainActivity extends Activity {
        private final LatLng LOCATION_BURNABY = new LatLng(49.27645, -122.917587);
        private final LatLng LOCATION_SURRREY = new LatLng(49.187500, -122.849000);
    
        private GoogleMap map;
    
         @Override
         protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
    
        map  = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
    
        map.addMarker(new MarkerOptions().position(LOCATION_SURRREY).title("Find me here!"));
        }
    
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
        }
    
         public void onClick_City(View v) {
         //     CameraUpdate update = CameraUpdateFactory.newLatLng(LOCATION_BURNABY);
        map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
        CameraUpdate update = CameraUpdateFactory.newLatLngZoom(LOCATION_BURNABY, 9);
        map.animateCamera(update);
         }
        public void onClick_Burnaby(View v) {
        map.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
        CameraUpdate update = CameraUpdateFactory.newLatLngZoom(LOCATION_BURNABY, 14);
        map.animateCamera(update);
    
         }
        public void onClick_Surrey(View v) {
        map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        CameraUpdate update = CameraUpdateFactory.newLatLngZoom(LOCATION_SURRREY, 16);
        map.animateCamera(update);
    
          }
    
         }