Select to view content in your preferred language

Error comes when Normalize geometries

4066
2
03-09-2015 09:58 PM
thilibu
Deactivated User

I'm new to ArcGIS runtime sdk and i want to add simple markers on the map.. So i tried the guid-> Display Information -> add graphics and text codes and before that i made the map by referring guid -> Tutorials -> Use ArcGIS base map.

Capture.PNG

After run this on my mobile device i got the error as follow.

Error is on the  Geometry normalized = GeometryEngine.normalizeCentralMeridian(mMapView.getExtent(), mMapView.getSpatialReference()); line.

03-10 10:20:38.475    4133-4133/com.example.t_buddhika.gis2 E/AndroidRuntime﹕ FATAL EXCEPTION: main

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.t_buddhika.gis2/com.example.t_buddhika.gis2.gis2}: java.lang.IllegalArgumentException: Input geometry can't be null.

            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2186)

            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)

            at android.app.ActivityThread.access$600(ActivityThread.java:145)

            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)

            at android.os.Handler.dispatchMessage(Handler.java:99)

            at android.os.Looper.loop(Looper.java:137)

            at android.app.ActivityThread.main(ActivityThread.java:5099)

            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:803)

            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)

            at dalvik.system.NativeStart.main(Native Method)

     Caused by: java.lang.IllegalArgumentException: Input geometry can't be null.

Please help me on this. Thank you very much.

0 Kudos
2 Replies
ShellyGill1
Esri Contributor

Hi,

I think you should move your normalizeCentralMeridian call (and everything that depends on it) to your onMapStatusChanged event after you check for the status INITIALIZED - the map only has an extent and spatial reference set once it's initialized.

thilibu
Deactivated User

thank u very much.

0 Kudos