The Android DeepAR SDK is not initializing with targetSDK 33 (Android 13)

I’m using the latest version of the DeepAR SDK (Android 5.2.0) in an Android project with targetSDK 33 (Android 13), and I didn’t receive the initialized() callback after initializing the SDK.

However, when I downgrade the Android project to targetSDK 32, the DeepAR SDK successfully calls initialized() and everything works fine.

I suspect that the issue might be related to the android.permission.WRITE_EXTERNAL_STORAGE permission. Perhaps the SDK is still expecting that permission, even though it has been deprecated for targetSDK 33.

Has anyone else encountered the same problem?

Hi, did you follow the getting started guide? Getting Started | DeepAR

We will investigate the permissions

Yes, I’ve followed that guide.

(Also Demo Projects isn’t using latest android target SDK)

@jelena @Zak

I’m adding additional information.

Archive Name: DeepAR-Android-v5.2.0 DeepAR SDK Version: v5.2.0

  1. I have installed an example project from the archive and added my LicenseKey.
    The example project is targeting Android API version 30 with compileSdkVersion 30. I have successfully run the current project on my test device (Android 13, samsung tab s8 ultra). After installation, I granted all the necessary permissions (CAMERA, RECORD_AUDIO, WRITE_EXTERNAL_STORAGE). The app works well, with the library initialized and the filter applied to my camera.

  2. I made some changes to target the latest Android version (Android API 33):

  • Changes in build.gradle (compileSdkVersion 33, targetSdkVersion 33).
  • Changes in the AndroidManifest.xml - added android:exported=“true” to MainActivity.
  • Added the following line Getting Started | DeepAR
    uses-native-library
    android:name=“libOpenCL.so”
    android:required=“false”
  • I also updated the Gradle version for support uses-native-library tag:
    android/build.gradle: => classpath 'com.android.tools.build:gradle:7.1.2' android/gradle/wrapper/gradle-wrapper.properties: => distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
  • and added
    uses-feature
    android:name=“android.hardware.camera”
    android:required=“false”
    for the camera permission.
  1. I uninstalled the previous version of the app from the device.
  2. I installed the new version and granted permissions (CAMERA, RECORD_AUDIO). The WRITE_EXTERNAL_STORAGE is not supported with target API 33… The DeepAR library is not initialized.

However, if I follow steps 1 and 2 without uninstalling the app (step 3), it means that I granted permissions with target API 30 and then just updated the app. The app will still have those permissions, and it will work well.

So, I noticed an issue that the latest DeepAR Android SDK release does not target the latest Android version yet, and it is waiting for the WRITE_EXTERNAL_STORAGE permission.

  1. Could you please connect to the topic Android developer ASAP to check the information I provided and confirm if it is indeed a problem? It’s possible that I might have missed something on my end.

It’s important to know for me ASAP.

  1. When do you plan to release the new version that addresses this issue?

Please let me know if you need any further information.

@jelena @Zak please check the questions above ASAP
Thanks!

Hi, thanks for the detailed report.

I have checked with the Android team. The Android 13 isn’t thoroughly tested yet.

  1. Your information seems to be all correct
  2. We aren’t entirely sure yet but the android team has been made aware of the issue and will try to resolve it

Is it possible for you to work with a lower target API for the time being?

Thanks for the answer! :pray:

Starting August 31, 2023 new apps and app updates must target API level 33 to be submitted to Google Play, Target API level requirements for Google Play apps - Play Console Help
so there is no reason to work with a lower API.

Waiting for the new version.

@jelena Do you have any updates about the progress on that issue?

@Zak @jelena any updates?

We have updated our quickstart to work with Android target API level 33. Please check if it works for you.

My assumption was that you were testing on a device that didn’t have API level 33, and for those devices you still need WRITE_EXTERNAL_STORAGE permission.

Hi @Disho
I’m using Samsung Galaxy Tab S8 with Android 13.

I’ve tested quickstart that you posted above on my device and still have the same problem.
(I see that the quickstart project uses the 5.3.0 version. (newest one). )

Additionally, I noticed that another user may be facing the same problem Video feed not starting on Samsung devices · Issue #41 · DeepARSDK/quickstart-android-java · GitHub

Have you tested the quickstart project with Android 13?

We’ve just had an update on the issue so check it out and see if it fixes the problem for you :smiley:

The issue has been resolved. Thanks!

2 Likes