Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.SecurityException registerReceiver crash on Android 14 #1256

Open
shaji-Dev opened this issue Nov 11, 2023 · 11 comments
Open

java.lang.SecurityException registerReceiver crash on Android 14 #1256

shaji-Dev opened this issue Nov 11, 2023 · 11 comments

Comments

@shaji-Dev
Copy link

shaji-Dev commented Nov 11, 2023

The library is crashing on registerApp.

With Android 14, registerReceiver() now has a required field, Context.RECEIVER_EXPORTED or Context.RECEIVER_NOT_EXPORTED.

Please add this parameter to your context.registerReceiver() calls so we can use the library in Android 14. Thank you.

Usind versions:

implementation('com.dji:dji-sdk:4.17') {
  exclude module: 'library-anti-distortion'
  exclude module: 'fly-safe-database'
}
compileOnly ('com.dji:dji-sdk-provided:4.17')
implementation ('com.dji:dji-uxsdk:4.16.2')

Log:

java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
                                                                                                    	at android.os.Parcel.createExceptionOrNull(Parcel.java:3069)
                                                                                                    	at android.os.Parcel.createException(Parcel.java:3053)
                                                                                                    	at android.os.Parcel.readException(Parcel.java:3036)
                                                                                                    	at android.os.Parcel.readException(Parcel.java:2978)
                                                                                                    	at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6137)
                                                                                                    	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
                                                                                                    	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853)
                                                                                                    	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841)
                                                                                                    	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772)
                                                                                                    	at dji.midware.usb.P3.UsbAccessoryService.registerAoaReceiver(Unknown Source:75)
                                                                                                    	at dji.midware.dgh.fdd(Unknown Source:42)
                                                                                                    	at dji.sdksharedlib.fdd.fdd(Unknown Source:6)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:15)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:27)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager.registerApp(Unknown Source:37)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager.access$1400(Unknown Source:0)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager$8.onDownloadSuccess(Unknown Source:6)
                                                                                                    	at dji.internal.jhg.fdd.fdd(Unknown Source:19)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager.lambda$registerApp$2(Unknown Source:27)
                                                                                                    	at dji.sdk.sdkmanager.DJISDKManager$$Lambda$4.run(Unknown Source:2)
                                                                                                    	at dji.sdksharedlib.dgh.dgh$fdd.run(Unknown Source:5)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
@dji-dev
Copy link
Contributor

dji-dev commented Nov 13, 2023

Agent comment from yating.liao in Zendesk ticket #94778:

The issue you are experiencing seems to be a new requirement introduced by Android 14 regarding broadcast reception. However, please note that the current version, 4.17, is only compatible with Android 13.
To learn more about the new features introduced in Android 14, you can visit the following link: https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported

°°°

@shaji-Dev
Copy link
Author

I know that, but is there any plans to update this version to be compatible with Android 14? It seems to be a simple fix, I think you only have one line of context.registerReceiver() in your SDK which is when registerApp is called, you just need to add the Context.RECEIVER_EXPORTED or Context.RECEIVER_NOT_EXPORTED flag.

Android 14 is starting to roll out and it doesn't make sense that most our users would have their app not supported anymore because of a simple fix.

Thank you.

@dji-dev
Copy link
Contributor

dji-dev commented Nov 14, 2023

Agent comment from yating.liao in Zendesk ticket #94778:

MSDK will continue to strive for compatibility with more Android devices, but the current version cannot set the targetVersion to Android 14. If it is urgent for you, can you please let us know the reason? I will provide this feedback to the team.

°°°

@shaji-Dev
Copy link
Author

I think I explained the urgency, most of our users have had the Android OS update popup and some have updated to Android 14 without realizing that the app will not work if they update, and as you know the problem is they cannot rollback to version 13 in their devices. So now there's no way they can use the app on their device unless the MSDK supports Android 14 because they cannot go back to Android 13, making their devices useless at the moment.

I think the fix should be simple enough to support Android 14, it seems that the error is coming from that line of code I mentioned earlier, please inform your team to try and target Android 14 (34) as this is urgent for our business, we have client complaints because of this issue that we cannot resolve for them, maybe a MSDK quick fix release to the alpha channel for now?

Thank you.

@dji-dev
Copy link
Contributor

dji-dev commented Nov 14, 2023

Agent comment from yating.liao in Zendesk ticket #94778:

You can submit your requirements through this address(https://sdk-forum.dji.net/hc/en-us/requests/new). If possible, we would appreciate it if you could let us know the industry you are in and provide some background information about your company.
We will collect user requirements through this channel, and the communication here can only be viewed internally.

°°°

@shaji-Dev
Copy link
Author

I submitted the request as you suggested (ID #95053).

Unfortunately I cannot provide information about the company through this channel as our products are not for commercial use.

Thank you.

@dji-dev
Copy link
Contributor

dji-dev commented Nov 15, 2023

Agent comment from yating.liao in Zendesk ticket #94778:

We have received your new issue and will proceed to address your concerns. However, please note that all SDK requirements need to go through a team review before we can determine the scheduling. Therefore, we are unable to decide on the SDK development plan.

°°°

@andrewdittmer
Copy link

+1 This bug is accounting for over 60% of our app crashes. I really hope this can be addressed soon. Thank you.

@Padreco-lbr
Copy link

+1 The longer this bug takes to be fixed, the more clients you will be dismissing/frustrating. Please fix this as soon as possible.

@Sugar666666tang
Copy link

Sugar666666tang commented Feb 15, 2024 via email

@shaji-Dev
Copy link
Author

Any news on a fix for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants