Open kenargo opened 4 years ago
We have not been able to get this to run correctly if we install it using an aab. Published through the play store the dynamic load works but the DJI registration hangs. Install locally using the command line the dynamic load fails. Do you have any idea what we're doing wrong.
I am having many problems with building appbundle and starting August 21 our only option for building an app will be appbundle This link has the information: https://android-developers.googleblog.com/2020/11/new-android-app-bundle-and-target-api.html
Can someone raise priority for this issue at DJI? As @josechagas mentioned above, Google will start forcing publishing using Android App Bundle format:
From August 2021, the Google Play Console will require all new apps to:
Publish with the Android App Bundle format.
Utilize Play Asset Delivery or Play Feature Delivery to deliver assets or features that exceed download size of 150MB. Expansion files (OBBs) will no longer be supported for new apps.
Target API level 30 (Android 11) or above and adjust for behavioral changes.
The time has come, and using app bundle still a big issue.. any solutions?
Sample code crashes when loading module on Android 11 Samsung device, it crashes on the following line:
Helper.install((Application) context.getApplicationContext());
below is the crash trace:
2022-03-31 05:25:51.205 3532-3532/? E/audit: type=1400 audit(1648693551.199:1851): avc: denied { execmod } for pid=2919 comm="ppbundlesupport" path="/apex/com.android.runtime/lib/bionic/libc.so" dev="dm-0" ino=392 scontext=u:r:untrusted_app:s0:c139,c257,c512,c768 tcontext=u:object_r:system_lib_file:s0 tclass=file permissive=0 SEPF_SM-T510_11_0010 audit_filtered
2022-03-31 05:25:51.205 3532-3532/? E/audit: type=1300 audit(1648693551.199:1851): arch=40000028 syscall=125 per=8 success=no exit=-13 a0=e61ae000 a1=1000 a2=7 a3=e6248fc8 items=0 ppid=3547 pid=2919 auid=4294967295 uid=10395 gid=10395 euid=10395 suid=10395 fsuid=10395 egid=10395 sgid=10395 fsgid=10395 tty=(none) ses=4294967295 comm="ppbundlesupport" exe="/system/bin/app_process32" subj=u:r:untrusted_app:s0:c139,c257,c512,c768 key=(null)
2022-03-31 05:25:51.205 3532-3532/? E/audit: type=1327 audit(1648693551.199:1851): proctitle="
For those trying to use the bundle sample as a way to correct device crashes and APK size issues there are a few items to note that might help.
The DJI fix resolved around placing the DJI SDK into a DFM (Android Dynamic Feature). While I expect this should work there are a few errors in the sample that are likely causing difficulties if you are unfamiliar with the DFM services in Android.
From an Architectural POV your complete app will become a DFM, with the root APK used to load the DFM, This is just how the DFM architecture works; nothing new here.
However, in the sample the API Key is located in the DFM's manifest (which is OK because manifests are merged) but it implies that the key is for the app ID of the DFM, it is not!!! The app ID the SDK sees is for the main APK. IMHO the key should be in the main APK's manifest (only because that is where the appID is defined but that's a preference and not a requirement).
The override for Application in the DFM is never instanced so don't place code in that file and instead use the Application override in the main APK. The reason the sample works with code in the DFM Application file is because they are all statics and don't use the app instance.
Note: it might help to think of the DFM as having a reference to the main APK but the main APK cannot reference the DFM. Meaning, don't add SDK calls into the main APK or you will have the same issues with using bundles as before.
One more note; I'm using the following in the DFM to load the SDK on install time. The sample loads it on-demand which also works but IMO it is more appropriate to load it at install time; you can choose your preference.
<dist:module dist:onDemand="true" dist:title="@string/title_dynamic_dji_sdk">
</dist:module>
Also, in the main sample APK there is this line: " ", it's unused and can be removed. The main APK isn't a DFM so there is no need for DFM attributes.
Hopefully this helps and feel free to ask questions. It's a fairly large undertaking because you need to keep the original appID with the main APK and rename everything else but it should work