你好世界地图(ArcGIS的) - Eclipse的模拟器不能正常运行ArcGIS应用程序 [英] Hello World Map (ArcGIS) - Eclipse's Emulator doesn't run ArcGIS app properly

查看:471
本文介绍了你好世界地图(ArcGIS的) - Eclipse的模拟器不能正常运行ArcGIS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跟着这个教程的步骤。我叫我的项目为HelloWorld3而不是HelloWorld的。我仔细地遵循所有的步骤,在我的HelloWorldActivity.java我删除了已经存在(默认),这是因为以下几点:

 包com.esri.arcgis.android.samples.helloworld3;进口android.app.Activity;
进口android.os.Bundle;
进口com.esri.android.map.MapView;
公共类HelloWorld3Activity延伸活动{    图形页面mMapView;    / **当第一次创建活动调用。 * /
    @覆盖
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);        mMapView =新的图形页面(本);    }    @覆盖
    保护无效的onDestroy(){
        super.onDestroy();
 }
    @覆盖
    保护无效的onPause(){
        super.onPause();
        mMapView.pause();
 }
    @覆盖保护无效onResume(){
        super.onResume();
        mMapView.unpause();
    }}

我改变了previous code,并且把这种code来代替:

 公共类HelloWorldActivity延伸活动{
    图形页面地图= NULL;    / **当第一次创建活动调用。 * /
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);        //从XML布局中的地图和初始区
        地图=(图形页面)findViewById(R.id.map);
        //添加动态层的MapView
        map.addLayer(新ArcGISTiledMapServiceLayer(+
        http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer));    }    保护无效的onPause(){
        super.onPause();
        map.pause();
    }    保护无效onResume(){
        super.onResume();
        map.unpause();
    }
}

(我也跟着发生了什么在本教程中提到的,但是绝对我把它命名为HelloWorld3Activity)

然后,我的code变成这个样子:

 包com.esri.arcgis.android.samples.helloworld3;进口android.app.Activity;
进口android.os.Bundle;
进口com.esri.android.map.MapView;
公共类HelloWorld3Activity延伸活动{    图形页面地图= NULL;    / **当第一次创建活动调用。 * /
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);        //从XML布局中的地图和初始区
        地图=(图形页面)findViewById(R.id.map);
        //添加动态层的MapView
        map.addLayer(新ArcGISTiledMapServiceLayer(+
        http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer));    }    保护无效的onPause(){
        super.onPause();
        map.pause();
    }    保护无效onResume(){
        super.onResume();
        map.unpause();
    }}

然而,有在ArcGISTiledMapServiceLayer红色下划线!!

这是什么问题?我不知道该怎么办!

我试图通过单击按Ctrl + Shift来解决问题+ O >>更新缺少的进口(希望它能够解决这个问题。
红色下划线消失了,我的code变成这个样子:

 包com.esri.arcgis.android.samples.helloworld3;进口android.app.Activity;
进口android.os.Bundle;进口com.esri.android.map.MapView;
进口com.esri.android.map.ags.ArcGISTiledMapServiceLayer;
公共类HelloWorld3Activity延伸活动{    图形页面地图= NULL;    / **当第一次创建活动调用。 * /
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.main);        //从XML布局中的地图和初始区
        地图=(图形页面)findViewById(R.id.map);
        //添加动态层的MapView
        map.addLayer(新ArcGISTiledMapServiceLayer(+
        http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer));    }    保护无效的onPause(){
        super.onPause();
        map.pause();
    }    保护无效onResume(){
        super.onResume();
        map.unpause();
    }}

后来,我试着运行它。我右键单击我的项目HelloWorld3,并点击运行方式> Android应用程序。
模拟器开始,我发现我的应用程序的图标。然而,当我点击它,这个屏幕(或窗口)出现了。

这是什么问题?
请帮助我!

* 的这个相关的问题我的previous Eclipse的仿真器(ArcGIS的Andr​​oid应用程序)?

我不知道,但我认为这是logcat的:

  12月10日至17日:38:19.820:I / dalvikvm(557):主题ID = 3:反应信号3
十二月10日至17日:38:19.871:I / dalvikvm(557):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:19.911:D / dalvikvm(557):试图加载的lib /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x412a6680
10-17 12:38:20.320的:I / dalvikvm(557):主题ID = 3:反应以信号3
十二月10日至17日:38:20.371:I / dalvikvm(557):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:20.582:D / dalvikvm(557):加入LIB /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x412a6680共享
十二月10日至17日:38:20.601:W / ApplicationContext对象(557):无法创建外部缓存目录
10-17 12:38:20.820的:I / dalvikvm(557):主题ID = 3:反应以信号3
十二月10日至17日:38:20.851:I / dalvikvm(557):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:21.711:W / ApplicationContext对象(557):无法创建外部缓存目录
十二月10日至17日:38:22.021:D / libEGL(557):没有模拟器检测GPU的支持。回退到软件渲染器。
十二月10日至17日:38:22.021:D / libEGL(557):装载/system/lib/egl/libGLES_android.so
十二月10日至17日:38:22.101:W / dalvikvm(557):主题ID = 11:螺纹未捕获的异常(组= 0x409c01f8)退出
十二月10日至17日:38:22.122:D / gralloc_goldfish(557):无仿真模拟GPU检测。
十二月10日至17日:38:22.132:E / AndroidRuntime(557):致命异常:GLThread 75
十二月10日至17日:38:22.132:E / AndroidRuntime(557):java.lang.IllegalArgumentException异常:无CONFIGS匹配configSpec
十二月10日至17日:38:22.132:E / AndroidRuntime(557):在com.esri.android.map.MapSurface $ a.chooseConfig(来源不明)
十二月10日至17日:38:22.132:E / AndroidRuntime(557):在android.opengl.GLSurfaceView $ EglHelper.start(GLSurfaceView.java:1009)
十二月10日至17日:38:22.132:E / AndroidRuntime(557):在android.opengl.GLSurfaceView $ GLThread.guardedRun(GLSurfaceView.java:1362)
十二月10日至17日:38:22.132:E / AndroidRuntime(557):在android.opengl.GLSurfaceView $ GLThread.run(GLSurfaceView.java:1216)
十二月10日至17日:38:29.820:D / dalvikvm(557):GC_CONCURRENT释放320K,5%的游离9217K / 9607K,暂停为6ms + 8ms的
十二月10日至17日:38:31.741:I /流程(557):发送信号。 PID:557 SIG:9
十二月10日至17日:38:38.980:I / dalvikvm(585):主题ID = 3:反应信号3
十二月10日至17日:38:39.121:I / dalvikvm(585):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:39.371:D / dalvikvm(585):试图加载的lib /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x4129e4c8
十二月10日至17日:38:39.490:I / dalvikvm(585):主题ID = 3:反应信号3
十二月10日至17日:38:39.532:I / dalvikvm(585):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:39.892:D / dalvikvm(585):加入LIB /data/data/com.esri.arcgis.android.samples.helloworld3/lib/libGLMapCore.so 0x4129e4c8共享
十二月10日至17日:38:39.900:W / ApplicationContext对象(585):无法创建外部缓存目录
十二月10日至17日:38:40.001:I / dalvikvm(585):主题ID = 3:反应信号3
十二月10日至17日:38:40.033:I / dalvikvm(585):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:40.501:I / dalvikvm(585):主题ID = 3:反应信号3
十二月10日至17日:38:40.530:W / ApplicationContext对象(585):无法创建外部缓存目录
十二月10日至17日:38:40.562:I / dalvikvm(585):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:40.780:D / libEGL(585):没有模拟器检测GPU的支持。回退到软件渲染器。
十二月10日至17日:38:40.780:D / libEGL(585):装载/system/lib/egl/libGLES_android.so
十二月10日至17日:38:40.911:D / gralloc_goldfish(585):无仿真模拟GPU检测。
十二月10日至17日:38:40.921:W / dalvikvm(585):主题ID = 11:螺纹未捕获的异常(组= 0x409c01f8)退出
十二月10日至17日:38:40.971:E / AndroidRuntime(585):致命异常:GLThread 78
十二月10日至17日:38:40.971:E / AndroidRuntime(585):java.lang.IllegalArgumentException异常:无CONFIGS匹配configSpec
十二月10日至17日:38:40.971:E / AndroidRuntime(585):在com.esri.android.map.MapSurface $ a.chooseConfig(来源不明)
十二月10日至17日:38:40.971:E / AndroidRuntime(585):在android.opengl.GLSurfaceView $ EglHelper.start(GLSurfaceView.java:1009)
十二月10日至17日:38:40.971:E / AndroidRuntime(585):在android.opengl.GLSurfaceView $ GLThread.guardedRun(GLSurfaceView.java:1362)
十二月10日至17日:38:40.971:E / AndroidRuntime(585):在android.opengl.GLSurfaceView $ GLThread.run(GLSurfaceView.java:1216)
十二月10日至17日:38:41.011:I / dalvikvm(585):主题ID = 3:反应信号3
十二月10日至17日:38:41.041:I / dalvikvm(585):写的堆栈跟踪到/data/anr/traces.txt
十二月10日至17日:38:42.511:D / dalvikvm(585):GC_CONCURRENT释放306K,4%免​​费9231K / 9607K,暂停为20ms + 123ms
十二月10日至17日:38:54.530:I /流程(585):发送信号。 PID:585 SIG:9


解决方案

在为Android在ArcGIS API最初发布时,模拟器将不会支持它由于缺乏OpenGL ES 2.0的支持。但是这种情况已经改变。看看<一个href=\"http://blogs.esri.com/esri/arcgis/2012/05/02/arcgis-runtime-sdk-for-android-v1-1-supports-android-emulator/\"相对=nofollow>这个。您可能需要进行一些更改目标环境/安装一些额外的软件包。

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.

这篇关于你好世界地图(ArcGIS的) - Eclipse的模拟器不能正常运行ArcGIS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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