Hello World Map (ArcGIS) - Eclipse 的模拟器无法正确运行 ArcGIS 应用程序 [英] Hello World Map (ArcGIS) - Eclipse's Emulator doesn't run ArcGIS app properly

查看:24
本文介绍了Hello World Map (ArcGIS) - Eclipse 的模拟器无法正确运行 ArcGIS 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了这个"

我不确定,但我认为这是 Logcat:

10-17 12:38:19.820: I/dalvikvm(557): threadid=3: 对信号 3 做出反应10-17 12:38:19.871:I/dalvikvm(557):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:19.911: D/dalvikvm(557): 尝试加载 lib/data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x412a668010-17 12:38:20.320: I/dalvikvm(557): threadid=3: 对信号 3 做出反应10-17 12:38:20.371:I/dalvikvm(557):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:20.582: D/dalvikvm(557): 添加了共享库/data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x412a668010-17 12:38:20.601:W/ApplicationContext(557):无法创建外部缓存目录10-17 12:38:20.820: I/dalvikvm(557): threadid=3: 对信号 3 做出反应10-17 12:38:20.851:I/dalvikvm(557):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:21.711:W/ApplicationContext(557):无法创建外部缓存目录10-17 12:38:22.021:D/libEGL(557):检测到没有 GPU 支持的模拟器.回退到软件渲染器.10-17 12:38:22.021:D/libEGL(557):加载/system/lib/egl/libGLES_android.so10-17 12:38:22.101: W/dalvikvm(557): threadid=11: 线程退出时出现未捕获的异常 (group=0x409c01f8)10-17 12:38:22.122:D/gralloc_goldfish(557):未检测到 GPU 仿真的模拟器.10-17 12:38:22.132:E/AndroidRuntime(557):致命异常:GLThread 7510-17 12:38:22.132: E/AndroidRuntime(557): java.lang.IllegalArgumentException: 没有与 configSpec 匹配的配置10-17 12:38:22.132: E/AndroidRuntime(557): 在 com.esri.android.map.MapSurface$a.chooseConfig(Unknown Source)10-17 12:38:22.132: E/AndroidRuntime(557): 在 android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1009)10-17 12:38:22.132: E/AndroidRuntime(557): 在 android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1362)10-17 12:38:22.132: E/AndroidRuntime(557): 在 android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)10-17 12:38:29.820:D/dalvikvm(557):GC_CONCURRENT 释放 320K,5% 释放 9217K/9607K,暂停 6ms+8ms10-17 12:38:31.741:I/Process(557):发送信号.PID:557 SIG:910-17 12:38:38.980:I/dalvikvm(585):threadid=3:对信号 3 做出反应10-17 12:38:39.121:I/dalvikvm(585):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:39.371: D/dalvikvm(585): 尝试加载 lib/data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x4129e4c810-17 12:38:39.490:I/dalvikvm(585):threadid=3:对信号 3 做出反应10-17 12:38:39.532:I/dalvikvm(585):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:39.892: D/dalvikvm(585): 添加了共享库/data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x4129e4c810-17 12:38:39.900:W/ApplicationContext(585):无法创建外部缓存目录10-17 12:38:40.001: I/dalvikvm(585): threadid=3: 对信号 3 做出反应10-17 12:38:40.033:I/dalvikvm(585):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:40.501: I/dalvikvm(585): threadid=3: 对信号 3 做出反应10-17 12:38:40.530:W/ApplicationContext(585):无法创建外部缓存目录10-17 12:38:40.562:I/dalvikvm(585):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:40.780:D/libEGL(585):检测到没有 GPU 支持的模拟器.回退到软件渲染器.10-17 12:38:40.780:D/libEGL(585):加载/system/lib/egl/libGLES_android.so10-17 12:38:40.911:D/gralloc_goldfish(585):未检测到 GPU 仿真的模拟器.10-17 12:38:40.921: W/dalvikvm(585): threadid=11: 线程退出时出现未捕获的异常 (group=0x409c01f8)10-17 12:38:40.971:E/AndroidRuntime(585):致命异常:GLThread 7810-17 12:38:40.971: E/AndroidRuntime(585): java.lang.IllegalArgumentException: 没有与 configSpec 匹配的配置10-17 12:38:40.971: E/AndroidRuntime(585): 在 com.esri.android.map.MapSurface$a.chooseConfig(Unknown Source)10-17 12:38:40.971: E/AndroidRuntime(585): 在 android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1009)10-17 12:38:40.971: E/AndroidRuntime(585): 在 android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1362)10-17 12:38:40.971: E/AndroidRuntime(585): 在 android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)10-17 12:38:41.011: I/dalvikvm(585): threadid=3: 对信号 3 做出反应10-17 12:38:41.041:I/dalvikvm(585):将堆栈跟踪写入/data/anr/traces.txt"10-17 12:38:42.511:D/dalvikvm(585):GC_CONCURRENT 释放 306K,4% 释放 9231K/9607K,暂停 20ms+123ms10-17 12:38:54.530:I/Process(585):发送信号.PID:585 SIG:9

解决方案

当 ArcGIS API for Android 最初发布时,由于缺乏 OpenGL ES 2.0 支持,模拟器不支持它.然而,这已经改变了.看看这个.您可能需要对目标环境进行一些更改/安装一些其他软件包.

I followed this tutorial’s steps. I named my project as "HelloWorld3" instead of "HelloWorld". I followed all the steps carefully, and in my "HelloWorldActivity.java" I deleted what was already there (by default) and it was as the following:

package com.esri.arcgis.android.samples.helloworld3;

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


import com.esri.android.map.MapView;


public class HelloWorld3Activity extends Activity {

    MapView mMapView ;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mMapView = new MapView(this);

    }

    @Override 
    protected void onDestroy() { 
        super.onDestroy();
 }
    @Override
    protected void onPause() {
        super.onPause();
        mMapView.pause();
 }
    @Override   protected void onResume() {
        super.onResume(); 
        mMapView.unpause();
    }

}

I changed the previous code, and put this code instead:

public class HelloWorldActivity extends Activity {
    MapView map = null;

    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Retrieve the map and initial extent from XML layout
        map = (MapView)findViewById(R.id.map);
        // Add dynamic layer to MapView
        map.addLayer(new ArcGISTiledMapServiceLayer("" +
        "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));

    }

    protected void onPause() {
        super.onPause();
        map.pause();
    }

    protected void onResume() {
        super.onResume();
        map.unpause();
    }
}

(I followed what was mentioned in the tutorial, but absolutely I named it as "HelloWorld3Activity")

And then, my code became like this:

package com.esri.arcgis.android.samples.helloworld3;

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


import com.esri.android.map.MapView;


public class HelloWorld3Activity extends Activity {

    MapView map = null;

    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Retrieve the map and initial extent from XML layout
        map = (MapView)findViewById(R.id.map);
        // Add dynamic layer to MapView
        map.addLayer(new ArcGISTiledMapServiceLayer("" +
        "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));

    }

    protected void onPause() {
        super.onPause();
        map.pause();
    }

    protected void onResume() {
        super.onResume();
        map.unpause();
    }

}

However, there was a red underline under "ArcGISTiledMapServiceLayer"!!

What is the problem?! I don’t know what to do!

I tried to solve the problem by clicking Ctrl+Shift+O >> to update the missing imports (hoping that it will solve the problem. The red underline disappeared, and my code became like this:

package com.esri.arcgis.android.samples.helloworld3;

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

import com.esri.android.map.MapView;
import com.esri.android.map.ags.ArcGISTiledMapServiceLayer;


public class HelloWorld3Activity extends Activity {

    MapView map = null;

    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        // Retrieve the map and initial extent from XML layout
        map = (MapView)findViewById(R.id.map);
        // Add dynamic layer to MapView
        map.addLayer(new ArcGISTiledMapServiceLayer("" +
        "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));

    }

    protected void onPause() {
        super.onPause();
        map.pause();
    }

    protected void onResume() {
        super.onResume();
        map.unpause();
    }

}

Afterward, I tried to run it. I right-clicked my project "HelloWorld3", and clicked on Run as > Android Application. The emulator started, and I found my application’s icon. However, when I clicked on it, this screen (or window) appeared.

What is the problem?! Please help me!!

*** This is my previous related question "Eclipse's Emulator (ArcGIS Android App)?"

I am not sure, but I think that this is the Logcat:

10-17 12:38:19.820: I/dalvikvm(557): threadid=3: reacting to signal 3
10-17 12:38:19.871: I/dalvikvm(557): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:19.911: D/dalvikvm(557): Trying to load lib /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x412a6680
10-17 12:38:20.320: I/dalvikvm(557): threadid=3: reacting to signal 3
10-17 12:38:20.371: I/dalvikvm(557): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:20.582: D/dalvikvm(557): Added shared lib /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x412a6680
10-17 12:38:20.601: W/ApplicationContext(557): Unable to create external cache directory
10-17 12:38:20.820: I/dalvikvm(557): threadid=3: reacting to signal 3
10-17 12:38:20.851: I/dalvikvm(557): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:21.711: W/ApplicationContext(557): Unable to create external cache directory
10-17 12:38:22.021: D/libEGL(557): Emulator without GPU support detected. Fallback to software renderer.
10-17 12:38:22.021: D/libEGL(557): loaded /system/lib/egl/libGLES_android.so
10-17 12:38:22.101: W/dalvikvm(557): threadid=11: thread exiting with uncaught exception (group=0x409c01f8)
10-17 12:38:22.122: D/gralloc_goldfish(557): Emulator without GPU emulation detected.
10-17 12:38:22.132: E/AndroidRuntime(557): FATAL EXCEPTION: GLThread 75
10-17 12:38:22.132: E/AndroidRuntime(557): java.lang.IllegalArgumentException: No configs match configSpec
10-17 12:38:22.132: E/AndroidRuntime(557):  at com.esri.android.map.MapSurface$a.chooseConfig(Unknown Source)
10-17 12:38:22.132: E/AndroidRuntime(557):  at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1009)
10-17 12:38:22.132: E/AndroidRuntime(557):  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1362)
10-17 12:38:22.132: E/AndroidRuntime(557):  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
10-17 12:38:29.820: D/dalvikvm(557): GC_CONCURRENT freed 320K, 5% free 9217K/9607K, paused 6ms+8ms
10-17 12:38:31.741: I/Process(557): Sending signal. PID: 557 SIG: 9
10-17 12:38:38.980: I/dalvikvm(585): threadid=3: reacting to signal 3
10-17 12:38:39.121: I/dalvikvm(585): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:39.371: D/dalvikvm(585): Trying to load lib /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x4129e4c8
10-17 12:38:39.490: I/dalvikvm(585): threadid=3: reacting to signal 3
10-17 12:38:39.532: I/dalvikvm(585): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:39.892: D/dalvikvm(585): Added shared lib /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x4129e4c8
10-17 12:38:39.900: W/ApplicationContext(585): Unable to create external cache directory
10-17 12:38:40.001: I/dalvikvm(585): threadid=3: reacting to signal 3
10-17 12:38:40.033: I/dalvikvm(585): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:40.501: I/dalvikvm(585): threadid=3: reacting to signal 3
10-17 12:38:40.530: W/ApplicationContext(585): Unable to create external cache directory
10-17 12:38:40.562: I/dalvikvm(585): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:40.780: D/libEGL(585): Emulator without GPU support detected. Fallback to software renderer.
10-17 12:38:40.780: D/libEGL(585): loaded /system/lib/egl/libGLES_android.so
10-17 12:38:40.911: D/gralloc_goldfish(585): Emulator without GPU emulation detected.
10-17 12:38:40.921: W/dalvikvm(585): threadid=11: thread exiting with uncaught exception (group=0x409c01f8)
10-17 12:38:40.971: E/AndroidRuntime(585): FATAL EXCEPTION: GLThread 78
10-17 12:38:40.971: E/AndroidRuntime(585): java.lang.IllegalArgumentException: No configs match configSpec
10-17 12:38:40.971: E/AndroidRuntime(585):  at com.esri.android.map.MapSurface$a.chooseConfig(Unknown Source)
10-17 12:38:40.971: E/AndroidRuntime(585):  at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1009)
10-17 12:38:40.971: E/AndroidRuntime(585):  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1362)
10-17 12:38:40.971: E/AndroidRuntime(585):  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
10-17 12:38:41.011: I/dalvikvm(585): threadid=3: reacting to signal 3
10-17 12:38:41.041: I/dalvikvm(585): Wrote stack traces to '/data/anr/traces.txt'
10-17 12:38:42.511: D/dalvikvm(585): GC_CONCURRENT freed 306K, 4% free 9231K/9607K, paused 20ms+123ms
10-17 12:38:54.530: I/Process(585): Sending signal. PID: 585 SIG: 9

解决方案

When the ArcGIS API for Android was originally released, the emulator would not support it due to a lack OpenGL ES 2.0 support. That has changed however. Take a look at this. You may need to make some changes to your target environment/install some additional packages.

这篇关于Hello World Map (ArcGIS) - Eclipse 的模拟器无法正确运行 ArcGIS 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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