【问题标题】:MapView slow to load on AndroidMapView 在 Android 上加载缓慢
【发布时间】:2017-01-20 23:54:05
【问题描述】:

我以编程方式在一个 android 片段中创建了 mapview:Programmatically Creating MapView and Adding a Marker Results in a null pointer exception in the fragment

但是,我在尝试加载时收到以下错误:

01-20 15:50:02.337 3542-3692/? E/DynamiteModule: Failed to load DynamiteLoader: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.example.mypackage-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.mypackage-1/lib/arm, /system/fake-libs, /data/app/com.example.mypackage-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]

这是地图视图:

注意:就这样永远卡住了。不知道有什么问题。另外,我正在使用 Eclipse 构建我的项目(它没有更新为使用 Android Studio)。

我该如何解决这个问题?

【问题讨论】:

    标签: android google-play-services android-mapview


    【解决方案1】:

    按照以下步骤开始工作:

    Android Map loading very slow/not loading at all in started activity until clicking on it

       @Override
        public void onResume() {
            mapView.onResume();
            super.onResume();
        }
    
        @Override
        public void onPause() {
            super.onPause();
            mapView.onPause();
        }
    
        @Override
        public void onDestroy() {
            super.onDestroy();
            mapView.onDestroy();
        }
    
        @Override
        public void onLowMemory() {
            super.onLowMemory();
            mapView.onLowMemory();
        }
    

    【讨论】:

      【解决方案2】:

      确保将以下 3 行添加到 xml 中的 MapView 标记

          xmlns:map="http://schemas.android.com/apk/res-auto"
          map:mapType="normal"
          map:liteMode="true"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-10-16
        • 1970-01-01
        • 2012-09-26
        • 2012-08-30
        • 2017-01-16
        • 1970-01-01
        • 1970-01-01
        • 2017-06-06
        相关资源
        最近更新 更多