dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
985 stars 578 forks source link

Popup while initializing mapbox in MapWidget: App won't run without Google Play services, which are not supported by your device. #906

Open DavisDevasia opened 3 years ago

DavisDevasia commented 3 years ago

DJI Android SDK Version: 4.14 DJI Android UXSDK Version: 4.14.1

Android Device: DJI Smart Controller

We are trying to use DJI's MapWidget to allow the users to use Mapbox Map on devices where Google Maps are unavailable.

But when initialising mapbox in DJI's MapWidget on a device without Google Play services, it shows an alert box saying "{app name} won't run without Google Play Services, which are not supported by your device."

The message coveys that the app won't work properly without Play Services but the mapbox map becomes visible and the user can interact with the map after pressing "Ok" in the alert box.

Relevant code

import dji.ux.widget.MapWidget
...
@BindView(R.id.map_widget)
lateinit var mapWidget: MapWidget
...
mapWidget.initMapboxMap(onMapReadyListener, access_token)

Logcat

2021-06-04 08:24:51.984 5816-5816/com.package.name E/GoogleApiAvailability: Google Play services is invalid. Cannot recover.

Checking the availability of Google Play services and showing this popup may be avoided if the app tries to initialise maps other than Google Maps in the DJI MapWidget. Is there any way to suppress this alert box?

dji-dev commented 3 years ago

Agent comment from William Wong in Zendesk ticket #48821:

Dear Client Thank you for contacting DJI.

I think somehow your app tries to activate some Google Service, It is not related with your mapbox as it can run without any problem. You have to go through your code carefully to see if you are using any Google Service. We recoomand you use the open-source UXSDK then you can do what ever you can to prevent any potential error. BETA:https://github.com/dji-sdk/Mobile-UXSDK-Beta-Android Similar Issue:https://www.youtube.com/watch?v=N-2XJdhkvsE

Hopefully our solution can help you. Kindly Regards, DJI Developer Support

°°°

furick1 commented 3 years ago

DJI compiled UX SDK causes issue and can fix by switching to open source variant that doesn't have same error or otherwise comment out calls in OS variant that improperly initialize google services when mapbox is called via the DJIMap class.