[Arcgis-android-sdk-10.2.X] StrictMode in MapView

367
0
09-27-2016 02:04 AM
YOUNG_GONBAEK
New Contributor

Now, I am using an argis android sdk 10.2.x in which version is actually "10.2.8-1" upgraded from "10.2.7".

I got an error messessages  while I ran a android project on the phone(galaxy 2014 edition and galaxy tab 2) in 'StrictMode' running.

There are two cases of the strict mode error as following

1. java.lang.Throwable: Explicit termination method 'end' not called

1.1. Native library loading

...skip

at java.net.URL.openStream(URL.java:470)

at java.lang.Class.getResourceAsStream(Class.java:1175)

at com.esri.android.map.LocationDisplayManager$a.<init>(SourceFile:767)

...skip...

 A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.

It seems to be the situation when a try statement without finally block of code in LocationManager class, where the native library of arcgis is loading from user app's system path.

try

{

   in = LocationManager.class.getResourceAsStream("arcgis.map")

   in.close();

}

catch(error e)

{

 ...some error handling

}

finally

{

   if(in != null) try{ in.close(); in = null; }catch(IOException){ }

}

1.2. Network communication with Arcgis server

at org.apache.http.conn.BasicManagedEntity.getContent(BasicManagedEntity.java:105)

at org.apache.http.util.EntityUtils.toString(EntityUtils.java:117)

at com.esri.core.internal.io.handler.h$1.handleResponse(SourceFile:201)

...skip...

at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:742)

 A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.

This might be also the same point described in "1.1 Native library loading".  The resource must be released by close method explicitly.

2. No data tile ETag couldn't be retrieved

This message is always catched by debugger with name of "ArcGIS" tag.

com.esri.core.io.EsriServiceException: Not Found

...skip

at com.esri.android.map.ags.ArcGISTiledMapServiceLayer.retrieveNoDataTileETag(SourceFile:570)

at com.esri.android.map.ags.ArcGISTiledMapServiceLayer.initLayer(SourceFile:201)

...skip

The initLayer method of ArcGISTiledMapServiceLayer class is protected so there is no way to handle this error message by user like me.

Even I can not find the exact point where my code conflict...

3. My opinion and question about this issue.

I think the number 1.1 and 1.2 must be patched quickly.

As about number 2,

Is there any way to handle  or avoid these errors from arcgis library?

your answer will be appreciated.

Thanks.

Tags (3)
0 Kudos
0 Replies