Mobile-SDK-Android icon indicating copy to clipboard operation
Mobile-SDK-Android copied to clipboard

Any plan to support Android 14 with targetSdk = 34

Open huongta157 opened this issue 1 year ago • 46 comments

Screenshot 2024-07-05 at 08 36 42 Does your team have any plan to support Android 14 with targetSdk = 34?

Note: Currently I using target Sdk = 33 so my app work normal

Thank team so much! I hope to receive answer from your team early.

huongta157 avatar Jul 05 '24 01:07 huongta157

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

I have not received a plan to adapt to Android 14 yet. I will inform the team about this information. Thank you for your feedback.

°°°

dji-dev avatar Jul 05 '24 10:07 dji-dev

@dji-dev Please inform me if have any update for this Thank you so much!

huongta157 avatar Jul 09 '24 13:07 huongta157

@dji-dev we would also really appreciate if SDK 4 could be updated to target Android 14 (API level 34), otherwise we will not be able to provide updates to our app after August 31st 2024. Thank you

brien-crean avatar Jul 09 '24 17:07 brien-crean

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

I will convey your strong feedback to the team.

°°°

dji-dev avatar Jul 10 '24 10:07 dji-dev

@dji-dev I would also like to make this request as we have an app using your SDK. When we target API level 34, the app crashes with exception:

java.lang.SecurityException: my.package.com: 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:6157) 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.sdk.sdkmanager.DJISDKManager.registerProductAccessManager(Unknown Source:36) at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:196) at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:12) at dji.sdk.sdkmanager.DJISDKManager.registerApp(Unknown Source:37) at dji.sdk.sdkmanager.DJISDKManager.access$1300(Unknown Source:0) at dji.sdk.sdkmanager.DJISDKManager$8.onDownloadSuccess(Unknown Source:6) at dji.internal.flysafe.fdd.fdd(Unknown Source:19) at dji.sdk.sdkmanager.DJISDKManager.lambda$registerApp$2(Unknown Source:27) at dji.sdk.sdkmanager.DJISDKManager$$Lambda$5.run(Unknown Source:2) at dji.sdksharedlib.util.dgh$fdd.run(Unknown Source:5)

Thanks!

Simon-Richards avatar Jul 15 '24 12:07 Simon-Richards

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

The current released MSDK version does not support Android 14. The crashes you are experiencing are also due to this.

°°°

dji-dev avatar Jul 16 '24 03:07 dji-dev

The linked Zendesk ticket isnt working for me. Can anyone explain what that was about? Or has there been any updates? August 31st is sooner than you think... Please DJI.

and we get it, "work expands to fill the time available for its completion", but the rest of us need your work done so we can get our work done before the 31st.

dscottbot avatar Jul 18 '24 17:07 dscottbot

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

Google offers the option to extend, you can apply for it until November. The plans we currently understand may not be completed by August 31st.
image.png

°°°

dji-dev avatar Jul 19 '24 07:07 dji-dev

@dji-dev The plan is in progress, right?

huongta157 avatar Aug 02 '24 02:08 huongta157

Apart from the requirements from the Google Store, do you have any other expectations for Android 14? For example, new features in Android 14? I would like to understand if failing to release the compatible version by August 31st would be a blocking issue. If so, could you please explain why?@huongta157 @Simon-Richards @brien-crean

At this moment, I cannot confirm if a version compatible with Android 14 will be released before August 31st, as the development time is too short. If the app has already been released, you can try applying for an extension with Google.

dji-lyt avatar Aug 02 '24 08:08 dji-lyt

@dji-lyt Thank you for your feedback.

  • I want SDK to worked in Android 14 with targetSdk = 34
  • Yes, I have extended until November, so Can your team release it before November?

huongta157 avatar Aug 02 '24 09:08 huongta157

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

Could you let us know what you can achieve with targetSdk = 34? Or what value it brings to you?

°°°

dji-dev avatar Aug 02 '24 11:08 dji-dev

@dji-dev @dji-lyt The value it brings is the ability to continue to distribute our app via Google Play. If DJI SDK 4 does not support targetSdk = 34 then we would have to find some other means of distributing our app which is extremely inconvenient and reduces our apps visibility.

We have already been granted an extension up until November 1st, but beyond that our app will be removed from the Play store if this SDK is not updated to support targetSdk = 34.

Will it be possible for SDK 4 to support targetSdk = 34 before November 1st?

brien-crean avatar Aug 02 '24 14:08 brien-crean

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

I will relay the information you provided to our team. However, I have not yet received an estimated timeline. The plan is to adapt to Android 14 in the next version.

°°°

dji-dev avatar Aug 05 '24 08:08 dji-dev

I have the same problem, however the last update I published to my app on the Google Play store included targetSdk=34 so now I'm stuck with an app deployed that crashes on newer phones with no option to downgrade. This happened because I only tested my app on an older Android device.

I thought perhaps I could fork this repo and make the necessary changes however I find that this repo doesn't contain the source code 👎

I'm pretty upset all-round. If the new v5 DJI SDK supported all the drones, then I would have migrated to it by now - however this isn't the case. It's a pretty minor change to make it work, just call registerReceiver differently depending on the Android SDK version like below:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
    registerReceiver(mReceiver, filter, RECEIVER_NOT_EXPORTED);
}else {
    registerReceiver(mReceiver, filter);
}

It's crashing at dji.midware.usb.P3.UsbAccessoryService.registerAoaReceiver. Here's the full stack trace:

java.lang.SecurityException: com.abc.xyz 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:6157)
        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:75)
        at dji.midware.dgh.fdd(Unknown:42)
        at dji.sdksharedlib.fdd.fdd(Unknown:6)
        at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown:15)
        at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown:12)
        at dji.sdk.sdkmanager.DJISDKManager.registerApp(Unknown:37)
        at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown)
        at dji.sdk.sdkmanager.DJISDKManager$8$1.onDownloadSuccess(Unknown:8)
        at dji.internal.jhg.fdd.fdd(Unknown:19)
        at dji.sdk.sdkmanager.DJISDKManager$8.run(Unknown:37)
        at dji.sdksharedlib.dgh.gfd$fdd.run(Unknown: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)

I hope it's fixed soon, there's definitely demand for it!

lachlanwp avatar Sep 01 '24 04:09 lachlanwp

@lachlanwp We will address the crashes you are experiencing in the version compatible with Android 14. We do not recommend configuring targetSDKversion=34 in the current version, so the latest version is only compatible with Android 13.

dji-lyt avatar Sep 02 '24 03:09 dji-lyt

same problem here, glad to see DJI team on it, please keep us posted for any update, thanks

mitchrsm avatar Sep 02 '24 13:09 mitchrsm

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

Of course, I will update the compatibility status of Android 14 here.

°°°

dji-dev avatar Sep 03 '24 04:09 dji-dev

Hi, my app meets the same problem, every phones with android 14 are crash when we update our app to API 34, (my app is user MSDK4). Please let me know when your team is update MSDK 4 that compatible to android 14, hoping it will be soon because 1/11, all app needs to up to date API 34.

ngocanhbui1411 avatar Sep 17 '24 07:09 ngocanhbui1411

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

I am currently unable to provide an exact timeline, but we will have a version compatible with Android 14 before November.

°°°

dji-dev avatar Sep 18 '24 09:09 dji-dev

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

The MSDK V5 has just released a test version compatible with Android 14. The MSDK V4 will also have a version compatible with Android 14 released in the future. https://github.com/dji-sdk/Mobile-SDK-Android-V5/tree/dev-sdk-alpha

°°°

dji-dev avatar Sep 18 '24 09:09 dji-dev

It also crashes at dji.sdk.sdkmanager.DJISDKManager.registerProductAccessManager

geeksilva97 avatar Sep 25 '24 16:09 geeksilva97

The test version compatible with Android 14 has been released:https://github.com/dji-sdk/Mobile-SDK-Android/tree/sdk_releases/4.18-alpha @brien-crean @geeksilva97 @mitchrsm @lachlanwp

dji-lyt avatar Sep 26 '24 07:09 dji-lyt

The test version compatible with Android 14 has been released:https://github.com/dji-sdk/Mobile-SDK-Android/tree/sdk_releases/4.18-alpha @brien-crean @geeksilva97 @mitchrsm @lachlanwp

quick question. READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are now deprecated. Shouldn't these two be replaced with other permissions in Sample code?

From my tests no Android 14 both will always be denied.

geeksilva97 avatar Sep 26 '24 12:09 geeksilva97

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

The sample code is not exclusively for Android 14; for instance, the system version of the DJI RM500 remote controller is still 7 or 6.

Are you experiencing any issues when running the sample code on Android 14?

°°°

dji-dev avatar Sep 27 '24 07:09 dji-dev

The test version compatible with Android 14 has been released:https://github.com/dji-sdk/Mobile-SDK-Android/tree/sdk_releases/4.18-alpha @brien-crean @geeksilva97 @mitchrsm @lachlanwp

quick question. READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are now deprecated. Shouldn't these two be replaced with other permissions in Sample code?

From my tests no Android 14 both will always be denied.

@geeksilva97, I had similar issues and I tracked back via parent commits to work it out. I think you need to keep the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in the AndroidManifest.xml, however in the sample code they updated it to be conditional based on Android O.S. version like this:

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            permissionArrays = new String[]{
                    Manifest.permission.VIBRATE, // Gimbal rotation
                    Manifest.permission.INTERNET, // API requests
                    Manifest.permission.ACCESS_WIFI_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_COARSE_LOCATION, // Maps
                    Manifest.permission.ACCESS_NETWORK_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_FINE_LOCATION, // Maps
                    Manifest.permission.CHANGE_WIFI_STATE, // Changing between WIFI and USB connection
                    Manifest.permission.BLUETOOTH, // Bluetooth connected products
                    Manifest.permission.BLUETOOTH_ADMIN, // Bluetooth connected products
                    Manifest.permission.READ_PHONE_STATE, // Device UUID accessed upon registration
                    Manifest.permission.RECORD_AUDIO,// Speaker accessory
            };
        } else {//兼容Android 12
            permissionArrays = new String[]{
                    Manifest.permission.VIBRATE, // Gimbal rotation
                    Manifest.permission.INTERNET, // API requests
                    Manifest.permission.ACCESS_WIFI_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_COARSE_LOCATION, // Maps
                    Manifest.permission.ACCESS_NETWORK_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_FINE_LOCATION, // Maps
                    Manifest.permission.CHANGE_WIFI_STATE, // Changing between WIFI and USB connection
                    Manifest.permission.WRITE_EXTERNAL_STORAGE, // Log files
                    Manifest.permission.BLUETOOTH, // Bluetooth connected products
                    Manifest.permission.BLUETOOTH_ADMIN, // Bluetooth connected products
                    Manifest.permission.READ_EXTERNAL_STORAGE, // Log files
                    Manifest.permission.READ_PHONE_STATE, // Device UUID accessed upon registration
                    Manifest.permission.RECORD_AUDIO // Speaker accessory
            };
        }

Here's the source: https://github.com/dji-sdk/Mobile-SDK-Android/commit/2a142f2d333eb65bdb923a225432813e2c93c709 See file Sample Code/app/src/main/java/com/dji/sdk/sample/internal/view/MainContent.java

lachlanwp avatar Sep 27 '24 12:09 lachlanwp

@dji-dev @dji-lyt I've nearly got it running, however I noticed that somewhere along the updates this was changed:

From this:

...
com.secneo.sdk.Helper.install(MApplication.this);
...

To this:

...
com.cySdkyc.clx.Helper.install(MApplication.this);
...

And the proguard-rules.pro was changed

From this:

...
-keep class com.secneo.** { *; }
...

To this:

...
-keep class com.cySdkyc.** { *; }
...

I tried to update my source, however my app fails as below:

No implementation found for void com.cySdkyc.clx.Helper.i() (tried Java_com_cySdkyc_clx_Helper_i and Java_com_cySdkyc_clx_Helper_i__) - is the library loaded, e.g. System.loadLibrary?

and it won't let me connect to the aircraft so I can go to fly mode.

It's also noted in the official docs here: https://developer-dji-com.translate.goog/doc/mobile-sdk-tutorial/cn/?_x_tr_sl=zh-CN&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc

Any help would be greatly appreciated and it might help other folks who are also upgrading.

lachlanwp avatar Sep 27 '24 12:09 lachlanwp

Oh, I could handle it. I'm projecting more ppl facing the same thing and not knowing exactly what to do till the search a lot and fall here.

@dji-dev I know the sample is not exclusively for Android 14. But Sample Code should work on Android 14 too.

geeksilva97 avatar Sep 27 '24 18:09 geeksilva97

@dji-dev any clue for when we have dji-uxsdk too? I'm getting the following error

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeReleaseNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libDJICSDKCommon.so' from inputs:
      - /Users/edysilva/.gradle/caches/transforms-3/73ea942cea79d1fa099fdc8f34cc965c/transformed/jetified-dji-sdk-alpha-4.18-a1/jni/arm64-v8a/libDJICSDKCommon.so
      - /Users/edysilva/.gradle/caches/transforms-3/004070d3edf6633274c45e074e8956cf/transformed/jetified-dji-sdk-4.16.2/jni/arm64-v8a/libDJICSDKCommon.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

app/build.gradle

    implementation ('com.dji:dji-uxsdk:4.16.2', {
        /**
         * Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
         * Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
         * is called.
         * Both will greatly reducing the size of the APK.
         */
        //exclude module: 'library-anti-distortion'
        exclude module: 'fly-safe-database'
        exclude group: 'com.mapbox.mapboxsdk' // this dependency is no longer needed
        exclude group: 'com.amap.api' //because of problems with GOOGLE PLAY
    })


    implementation ('com.dji:dji-sdk-alpha:4.18-a1',{
        /**
         * Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
         * Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
         * is called.
         * Both will greatly reducing the size of the APK.
         */
        //exclude module: 'library-anti-distortion'
        exclude module: 'fly-safe-database'
        exclude group: 'com.amap.api' //because of problems with GOOGLE PLAY
    })
    compileOnly ('com.dji:dji-sdk-provided-alpha:4.18-a1')

Looks like dependencies from dji-uxsdk are conflicting with dji-sdk-alpha.

This was not happening with version 'com.dji:dji-sdk:4.17

geeksilva97 avatar Sep 27 '24 20:09 geeksilva97

The test version compatible with Android 14 has been released:https://github.com/dji-sdk/Mobile-SDK-Android/tree/sdk_releases/4.18-alpha @brien-crean @geeksilva97 @mitchrsm @lachlanwp

quick question. READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are now deprecated. Shouldn't these two be replaced with other permissions in Sample code? From my tests no Android 14 both will always be denied.

@geeksilva97, I had similar issues and I tracked back via parent commits to work it out. I think you need to keep the READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in the AndroidManifest.xml, however in the sample code they updated it to be conditional based on Android O.S. version like this:

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            permissionArrays = new String[]{
                    Manifest.permission.VIBRATE, // Gimbal rotation
                    Manifest.permission.INTERNET, // API requests
                    Manifest.permission.ACCESS_WIFI_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_COARSE_LOCATION, // Maps
                    Manifest.permission.ACCESS_NETWORK_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_FINE_LOCATION, // Maps
                    Manifest.permission.CHANGE_WIFI_STATE, // Changing between WIFI and USB connection
                    Manifest.permission.BLUETOOTH, // Bluetooth connected products
                    Manifest.permission.BLUETOOTH_ADMIN, // Bluetooth connected products
                    Manifest.permission.READ_PHONE_STATE, // Device UUID accessed upon registration
                    Manifest.permission.RECORD_AUDIO,// Speaker accessory
            };
        } else {//兼容Android 12
            permissionArrays = new String[]{
                    Manifest.permission.VIBRATE, // Gimbal rotation
                    Manifest.permission.INTERNET, // API requests
                    Manifest.permission.ACCESS_WIFI_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_COARSE_LOCATION, // Maps
                    Manifest.permission.ACCESS_NETWORK_STATE, // WIFI connected products
                    Manifest.permission.ACCESS_FINE_LOCATION, // Maps
                    Manifest.permission.CHANGE_WIFI_STATE, // Changing between WIFI and USB connection
                    Manifest.permission.WRITE_EXTERNAL_STORAGE, // Log files
                    Manifest.permission.BLUETOOTH, // Bluetooth connected products
                    Manifest.permission.BLUETOOTH_ADMIN, // Bluetooth connected products
                    Manifest.permission.READ_EXTERNAL_STORAGE, // Log files
                    Manifest.permission.READ_PHONE_STATE, // Device UUID accessed upon registration
                    Manifest.permission.RECORD_AUDIO // Speaker accessory
            };
        }

Here's the source: 2a142f2 See file Sample Code/app/src/main/java/com/dji/sdk/sample/internal/view/MainContent.java

Thank you for your suggestion. I will forward it to the team.

dji-lyt avatar Sep 29 '24 03:09 dji-lyt