有人可以用我的osmroid RoadManger代码帮助我吗?

时间:2016-04-11 15:42:40

标签: android openstreetmap osmdroid

我按照https://github.com/MKergall/osmbonuspack/wiki/Tutorial_1的教程一切运作良好,直到我添加RoadManager在两点之间添加折线,android studio没有报告任何错误但是我的genymotion模拟器他告诉我不幸的是myapp已经停止而我尝试osmbonuspack主代码它很好地进入我的模拟器 请帮我这个项目 http://www.mediafire.com/download/9ssvn5g0t9m243m/osmcarte.rar

我的日志级别错误

04-11 17:32:14.853 3008-3008/com.osmdroid.android.osmdroidmap E/AndroidRuntime: FATAL EXCEPTION: main
                                                                            java.lang.RuntimeException: Unable to start activity ComponentInfo{com.osmdroid.android.osmdroidmap/com.osmdroid.android.osmdroidmap.MainActivity}: android.os.NetworkOnMainThreadException
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
                                                                                at android.app.ActivityThread.access$600(ActivityThread.java:141)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                at android.os.Looper.loop(Looper.java:137)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5041)
                                                                                at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:511)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
                                                                                at dalvik.system.NativeStart.main(Native Method)
                                                                             Caused by: android.os.NetworkOnMainThreadException
                                                                                at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
                                                                                at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
                                                                                at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
                                                                                at java.net.InetAddress.getAllByName(InetAddress.java:214)
                                                                                at com.squareup.okhttp.Dns$1.lookup(Dns.java:39)
                                                                                at com.squareup.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:184)
                                                                                at com.squareup.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:153)
                                                                                at com.squareup.okhttp.internal.http.RouteSelector.next(RouteSelector.java:95)
                                                                                at com.squareup.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:345)
                                                                                at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:328)
                                                                                at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:246)
                                                                                at com.squareup.okhttp.Call.getResponse(Call.java:276)
                                                                                at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:234)
                                                                                at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:196)
                                                                                at com.squareup.okhttp.Call.execute(Call.java:79)
                                                                                at org.osmdroid.bonuspack.utils.HttpConnection.doGet(HttpConnection.java:62)
                                                                                at org.osmdroid.bonuspack.utils.BonusPackHelper.requestStringFromUrl(BonusPackHelper.java:74)
                                                                                at org.osmdroid.bonuspack.routing.OSRMRoadManager.getRoads(OSRMRoadManager.java:178)
                                                                                at org.osmdroid.bonuspack.routing.OSRMRoadManager.getRoad(OSRMRoadManager.java:243)
                                                                                at com.osmdroid.android.osmdroidmap.MainActivity.onCreate(MainActivity.java:78)
                                                                                at android.app.Activity.performCreate(Activity.java:5104)
                                                                                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
                                                                                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
                                                                                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
                                                                                at android.app.ActivityThread.access$600(ActivityThread.java:141) 
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
                                                                                at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                at android.os.Looper.loop(Looper.java:137) 
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5041) 
                                                                                at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                                at java.lang.reflect.Method.invoke(Method.java:511) 
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
                                                                                at dalvik.system.NativeStart.main(Native Method) 

0 个答案:

没有答案