【问题标题】:App crashing in activity that implements Google maps API应用程序在实现 Google 地图 API 的活动中崩溃
【发布时间】:2013-09-21 19:19:48
【问题描述】:

我的应用程序中有以下活动,可在地图片段上设置地理位置,但是当我在测试中单击该活动时,它会崩溃并出现以下错误:

http://pastebin.com/6QhdL7z9

我查看了错误,但我无法理解为什么它会崩溃,因为它提到 main 作为原因之一。

这是我在 onCreate() 中调用代码以供参考的地方:

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map_gmit);
        /*map = (MapView)findViewById(R.id.map);
        map.setBuiltInZoomControls(true);*/

        //code to add a map marker at GMIT geographic location


        GoogleMap mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
        mMap.addMarker(new MarkerOptions()
                .position(new LatLng(53.271900177, -9.04889965057))
                .title("GMIT Galway Location"));;


    }

【问题讨论】:

    标签: android google-maps-api-3 android-fragments geolocation


    【解决方案1】:

    Android Studio 还是 Eclipse?

    您是否尝试在 SO 上进行搜索? ;) com.google.android.maps.MapView ClassNotFoundException Android - Google Maps API v2 - NoClassDefFoundError

    听起来您没有在项目中导出库.....

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-26
      • 1970-01-01
      • 1970-01-01
      • 2019-07-03
      • 1970-01-01
      • 2013-03-07
      • 2019-05-19
      • 1970-01-01
      相关资源
      最近更新 更多