Insta360Develop / CameraSDK-Android

Android SDK to control Insta360 cameras
82 stars 9 forks source link

Permissions handled on the latest SDK ? #17

Closed fareed945 closed 2 years ago

fareed945 commented 2 years ago

Hey, I face the following error while generating HDR images on my INSTA 360 ONE X, with the latest SDK version

implementation 'com.arashivision.sdk:sdkcamera:1.3.11' implementation 'com.arashivision.sdk:sdkmedia:1.3.11'

The same works fine with version 1.3.3


Error stack

W/System.err: at libcore.io.Posix.rename(Native Method) W/System.err: at libcore.io.BlockGuardOs.rename(BlockGuardOs.java:260) W/System.err: at java.io.File.renameTo(File.java:1043) W/System.err: at com.arashivision.sdkmedia.stitch.StitchUtils.generateHDR(:65) android.system.ErrnoException: rename failed: EXDEV (Cross-device link)

Please help @EternalSoySauce

EternalSoySauce commented 2 years ago

The same phone and project target sdk? There's no difference between the two sdk versions in StitchUtils.generateHDR

fareed945 commented 2 years ago

I tried debugging the code and I observed few changes in terms of default cache directory and stuff, on comparing the code between (1.3.3 and 1.3.11)

Yes, the same phone and the same target sdk (SDK 30) @EternalSoySauce FYI - Minimum target SDK is 23 for both the cases

EternalSoySauce commented 2 years ago

What's the outputPath you set? Have a try to use InternalPath?

fareed945 commented 2 years ago

@EternalSoySauce - Yes correct, I use the internal path (app specific private storage) and it gives me error

EternalSoySauce commented 2 years ago

Can you post your absolute outputPath to here? It seems that this exception is indeed a path permission problem of the target sdk 30 android.system.ErrnoException: rename failed: EXDEV (Cross-device link)

fareed945 commented 2 years ago

@EternalSoySauce This is the path, that I'm using, but it fails on device with SDK 23.

requireContext().getFilesDir() + "/" + "HDR_GENERATED_IMAGES" + "/" + "1.jpg"

Same was working in the SDK 1.3.3

fareed945 commented 2 years ago

One question here, the concept of scoped storage is only on devices with SDK 30 right ? Why doesn't this work on SDK 23 devices @EternalSoySauce

EternalSoySauce commented 2 years ago

Could you send a complete log of using this function to my mailbox? After I arrive at the company tomorrow morning, I will analyze it in detail. And I will also send our sdk demo app (v1.3.11, target 28) to you. You can use it to try if there is also any problem. I'm sure that there is no difference between the two versions of the SDK, currently I have no clue why version 1.3.3 is ok. Sorry.

This is my email address: yuhongfeng@insta360.com

fareed945 commented 2 years ago

This has been resolved in the latest release (1.3.15) Thanks