dji-sdk / Mobile-SDK-Android

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

DJISDKManager registerApp() hanging app when installed from an App Bundle #982

Open MeteC opened 3 years ago

MeteC commented 3 years ago

So I've been dealing with this problem for years - if I build my app as an APK, and submit it to the Play Store, it works fine. If I build the same app as an App Bundle, and submit it to the Play Store, then when I install and run that app, the whole thing hangs / crashes.

Luckily, I can repeat this using bundletool on my local machine, so I don't have to submit a new app every time I want to debug a line. But I've never managed to solve the problem and always came back to the fallback workaround - build and upload individual APKs of my app to Play Console, instead of an App Bundle.

But now that SDK 4.15 is out, the size of each APK in my project is now greater than 100MB, so this is no longer an option. Basically, I can't update the DJI SDK from now on. This is going to become a bigger and bigger problem as time ticks by, so I absolutely have to fix this.

Here's what I've found out:

I repeat - this doesn't happen if I build APKs. Only App Bundles. This problem has been around for me since at least SDK 4.10, back in 2019 (and I spoke with support (Lisa Fedane) about it but there was no resolution then apart from just building APKs instead.)

Does anyone have any clues / help here?

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #50735:

Dear Customer,

Thank you for contacting DJI. I'm not sure about your project. Here is an official bundle sample, please test and refer to it. https://github.com/DJI-Mobile-SDK-Tutorials/DJI-Android-SDK-Bundle-Sample

Thanks,

Luce Luo DJI Developer Support

°°°

MeteC commented 3 years ago

That's not helpful, that project is basically uncommented and undocumented apart from two readme files which give zero context or real instruction on the few steps they advise developers to take. This claims to be a tutorial but at best it's some sample code and developers need to take a forensic approach to figuring out what's happening.

What did help me was this https://github.com/dji-sdk/Mobile-SDK-Android/issues/642

In a nutshell, by adding the line android.bundle.enableUncompressedNativeLibs=false in gradle.properties, app bundle packaging seems to work fine now.

If DJI ever wants to explain why this is necessary, that would be extremely useful to all the developer community.

But the most useful thing of all? Include this information, along with all the other hacks we have to discover reading through DJI sample code to get our applications to work (like the arcane list of doNotStrips we find in your gradle files), in your FAQ.

brien-crean commented 3 years ago

Thank you so much for posting what worked for you! I have also been dealing with this issue for over a year and since I saw that aab files are now required I had to fix this issue. Adding android.bundle.enableUncompressedNativeLibs=false also worked for me

schox-nor commented 3 years ago

Is there any hope of getting the official DJI Fly app updated on the play store https://play.google.com/store/apps/details?id=dji.go.v5 @dji-dev now that the community has found a workaround for the defective SDK? Some users can't sideload because of corporate policy (including me)

Michael-DJI commented 3 years ago

@schox-nor you could download the apk file of DJI Fly directly on official web: https://www.dji.com/downloads/djiapp/dji-fly

schox-nor commented 3 years ago

Thanks for your reply @Michael-DJI - No I can't, our handsets are blocked from side-loading apps from web, or 3.rd party appstores by company profile.