AnsweredAssumed Answered

Invalid json when loading layer

Question asked by tboebb on Jun 7, 2018
Latest reply on Feb 26, 2019 by cvandrey_mnsengineers

Here is how I try to load a FeatureLayer:

override fun onCreate(savedInstanceState: Bundle?) {

    // inflate MapView from layout
    mMapView = findViewById(

    val leftPoint = Point(16.374120968073157, 48.186396114084104, SpatialReferences.getWgs84())

    //bottom right
    val rightPoint = Point(16.38101960965946, 48.18357774813336, SpatialReferences.getWgs84())
    val initialExtent = Envelope(leftPoint, rightPoint)

    map = ArcGISMap(Basemap.createLightGrayCanvas())

    map.initialViewpoint = Viewpoint(initialExtent)

    val serviceFeatureTable = ServiceFeatureTable("")

    // create feature layer from service feature tables
    val featureLayer = FeatureLayer(serviceFeatureTable)

    featureLayer.addDoneLoadingListener {
        Log.d(TAG, "layer loading done. error:" + featureLayer.loadError)


    // Pass a WebMap to the MapView constructor overload to display it. = map


logcat I see:

layer loading done. error:com.esri.arcgisruntime.ArcGISRuntimeException: Invalid JSON


This layer works fine on the web. It fails on android. Why is that?


I've also tried to load it as a webmap, which fails with the exact same error message (9 out of 10 layers fail to load here: )