react-native-arcgis-mapview icon indicating copy to clipboard operation
react-native-arcgis-mapview copied to clipboard

Android support?

Open thanmaic opened this issue 5 years ago • 16 comments

Hi, I want to implement esri maps in my react native project, so just wanted to know if this will support android as well for the basic functionality?

thanmaic avatar Jul 18 '19 10:07 thanmaic

Can i get a working example of how to use this library? I tried it on Android simulator, it is just blank No error also.

thanmaic avatar Jul 19 '19 13:07 thanmaic

even am facing similar issue. theres is no error its loading below screen

unnamed

rajashekar545 avatar Jul 22 '19 12:07 rajashekar545

Hey guys! Sorry for the delay. Work has been quite hectic. I'll look into this. I'll get back to you guys soon. Edit: Here's a sample implementation of the map.

        <ArcGISMapView ref={mapView => this.mapView = mapView} style={{width: 360, height: 500}}
          initialMapCenter={[{latitude: 34.055561, longitude: -117.182602}]}
          recenterIfGraphicTapped={true}
          rotationEnabled={false}
          onLayerPress={ this.onLayerPress }
          onRoutingStatusUpdate={this.onRoutingStatusUpdate}
          mapBasemap={ { type: 'normal' } }
          onSingleTap={this.onSingleTap}
      />

Don't forget to set a license key and an initial region. That could be a reason you're getting a grey screen.

davidgalindo avatar Jul 27 '19 20:07 davidgalindo

I have set the initial region as well. Is license key required for dev mode. As mentioned in the read me it says license key is required only for prod rite?

thanmaic avatar Jul 28 '19 13:07 thanmaic

Hey guys! Sorry for the delay. Work has been quite hectic. I'll look into this. I'll get back to you guys soon. Edit: Here's a sample implementation of the map.

        <ArcGISMapView ref={mapView => this.mapView = mapView} style={{width: 360, height: 500}}
          initialMapCenter={[{latitude: 34.055561, longitude: -117.182602}]}
          recenterIfGraphicTapped={true}
          rotationEnabled={false}
          onLayerPress={ this.onLayerPress }
          onRoutingStatusUpdate={this.onRoutingStatusUpdate}
          mapBasemap={ { type: 'normal' } }
          onSingleTap={this.onSingleTap}
      />

Don't forget to set a license key and an initial region. That could be a reason you're getting a grey screen.

How do i use onSingleTap? Can i get the current map point on tap?

hzbarkan avatar Aug 26 '19 08:08 hzbarkan

Anyone figure this out yet? iOS works great, but getting the same gray screen on Android. I have an initial region and license key set.

EDIT: Figured it out, my Android emulator did not have network access for some reason

JacobSolomonUCF avatar Nov 18 '19 19:11 JacobSolomonUCF

@davidgalindo I tried your github react native arcgis code using the below url. https://github.com/davidgalindo/react-native-arcgis-mapview/blob/master/AGSMapView.js

But end up getting this error. Can you look into this?

Screenshot_20191211-123902

Anujkumar12 avatar Dec 11 '19 07:12 Anujkumar12

If someone successfully implemented ArcGIS map functionality using react-native, can you please share the code.

Anujkumar12 avatar Dec 11 '19 07:12 Anujkumar12

@Anujkumar12 below is the link for working example. you can download [https://github.com/davidgalindo/react-native-arcgis-mapview/tree/d1590af77357959c5efbe96dcba7b9ccb9dbfc29/Example]

rajashekar545 avatar Dec 11 '19 07:12 rajashekar545

@rajashekar545 Thanks rajashekar for your help. I tried what you have mentioned above but still getting the same error. what could be the issue according to you Screenshot_20191211-130753

Anujkumar12 avatar Dec 11 '19 07:12 Anujkumar12

Hi @Anujkumar12

I experience a similar issue, I believe this is related to the device's architecture. The Esri Android SDK just recently started supporting 64-bit architectures. In the above error message, it appears your device has arm64-v8a. Try upgrading the SDK to at least 100.5.0. See the references below for further information.

https://developer.android.com/ndk/guides/abis https://community.esri.com/thread/228108-is-the-sdk-ready-for-64-bit-support https://developers.arcgis.com/android/latest/guide/release-notes-100-5.htm

JacobSolomonUCF avatar Dec 20 '19 20:12 JacobSolomonUCF

onSingleTap callback doesn't work for me. It just returns a synthetic event object, not the object written in docs. Does anybody know about this?

OsamaMukhtar avatar Jun 23 '20 09:06 OsamaMukhtar

I'm getting this error when trying to start the app:

Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.esri.arcgisruntime:arcgis-android:100.4.0.
     Required by:
         project :app > project :react-native-arcgis-mapview
      > Could not resolve com.esri.arcgisruntime:arcgis-android:100.4.0.
         > Could not get resource 'https://esri.bintray.com/arcgis/com/esri/arcgisruntime/arcgis-android/100.4.0/arcgis-android-100.4.0.pom'.
            > Could not GET 'https://esri.bintray.com/arcgis/com/esri/arcgisruntime/arcgis-android/100.4.0/arcgis-android-100.4.0.pom'. Received status code 403 from server: Forbidden

Someone knows how to fix it?

OGVLFullstack avatar Feb 08 '21 19:02 OGVLFullstack

HI @OGVLFullstack

I fixed that error by upgrading to at least 100.5.0. I had to change the maven url to https://esri.jfrog.io/artifactory/arcgis'.

I ended up going with the most recent version in my dependencies: implementation 'com.esri.arcgisruntime:arcgis-android:100.10.0' One of those errors required me to change.

RAlanWright avatar Mar 17 '21 22:03 RAlanWright

@Anujkumar12 below is the link for working example. you can download [https://github.com/davidgalindo/react-native-arcgis-mapview/tree/d1590af77357959c5efbe96dcba7b9ccb9dbfc29/Example]

Works great in RN ver. 0.64.5. It would be useful if a link is placed on the readme page.

giladm avatar Jun 08 '21 16:06 giladm

implementation 'com.esri.arcgisruntime:arcgis-android:100.10.0'

@Anujkumar12 Did you find a solution for this? I am facing the same error

LuckyMadu avatar Nov 23 '22 17:11 LuckyMadu