Dynamsoft / capture-vision-react-native-samples

Dynamsoft Capture Vision React-Native SDK Samples
https://www.dynamsoft.com/capture-vision/docs/introduction/
Other
15 stars 7 forks source link

iOS simulator stuck in SplashScreen - dynamsoft-capture-vision-react-native@1.1.8 #34

Closed chernandez-bunnings closed 1 year ago

chernandez-bunnings commented 1 year ago

Hello Dynamsoft team,

We noticed that from version 1.1.8 (also present in latest 1.1.9), the app gets stuck in the SplashScreen when the running the ios simulator. Inspecting logs and runtime activity unfortunately does not raise any insightful info or runtime exceptions that can point to the exact issue.

However backtracking the change history in our codebase we can clearly see that the issue started when the sdk version was bumped to 1.1.8

The app passes the SplashScreen on devices (android and ios) and emulator (android).

We understand that this camera sdk is supported for devices as they're the only ones with camera hardware to validate functionality for DynamsoftBarcodeReader and DynamsoftCameraEnhancer. However version 1.1.7 did not experience this issue and the simulator would work fine. We even downgraded the sdk to validate this is the case.

We cannot rely on device only for development purposes as other team members don't use a device to work on other functionality for the app. They may just use a simulator or an emulator. This issue basically will block their local development environment.

Details of the changes that introduced the issue

Podfile.lock

Perhaps this may have been introduced in the pods DynamsoftBarcodeReader (9.6.10) and DynamsoftCameraEnhancer (2.3.1) when dynamsoft-capture-vision-react-native version bump from 1.1.7 to 1.1.8?

Basically DynamsoftBarcodeReader (9.2.13) and DynamsoftCameraEnhancer (2.3.2) were free of this issue but had other issues such as scanRegion problems.

Could you please have a look and apologies for not offering more details.

Thanks a lot.

Dynamsoft-Henry commented 1 year ago

Hi @chernandez-bunnings

Thanks for reporting. We have found the reason but is it still not solved. When running on iOS, the library will initialize the camera module when the app starts. Since the simulator doesn't support a camera, it reports the issue. Also, this is the reason why you receive a camera permission request when the app start.

We are still working on this issue. It might take some time. I will let you know if we find a solution.

One more question. Do you have requirements to read barcodes on a simulator or just testing?

chernandez-bunnings commented 1 year ago

Hello @Dynamsoft-Henry,

Thank you for addressing this. We don't have a requirement to read barcodes in the simulator, but we do have a requirement to have the app working correctly in the simulator (as there are other team members that do not use device to develop or maintain other features in the app). The fact that the app is stuck in the SplashScreen is a big blocker for our development environment and will cause headaches amongst the team.

It is good to know that as soon as you solve this, both issues we currently experience in iOS will go away.

  1. I understand currently it is unknown, but would you have a rough estimate when you would hope for this be solved?

  2. Are the implementation changes of the pod libraries DynamsoftBarcodeReader - 9.6.10 and DynamsoftCameraEnhancer - 2.3.1 a good place to look for the fix? Prior to these versions the simulator worked fine.

Dynamsoft-Henry commented 1 year ago

Hello @chernandez-bunnings

  1. Our plan is to fix this issue at the latest before the end of next week. 2.1 Our SDK has code on both native iOS and React Native. I am not sure whether we need to change any code on React Native side. If there is no change on the React Native side, it will be fine to update the pod file only. 2.2 I'm sorry that we have never tested it on a simulator before. I don't know whether the previous versions work fine with simulators either. From now on, we will add simulators to the test items.
chernandez-bunnings commented 1 year ago

Hello @Dynamsoft-Henry Thank you again. I can assure the app would run fine in the simulator in version 1.1.7 (probably prior as well). I downgraded to confirm this. Of course the simulator cannot be used to ensure the camera sdk works correctly as you require the camera, but that's another topic. Fingers crossed there is a fix soon, so I'm not forced to downgrade :)

Dynamsoft-Henry commented 1 year ago

Hello @chernandez-bunnings

Sorry for delay. We fixed the above issues and released a new version, v1.1.11.

We have changes on both React Native and iOS side. As a result, please upgrade the dependency of dynamsoft-capture-vision-react-native.

chernandez-bunnings commented 1 year ago

Hello @Dynamsoft-Henry

Apologies for the late reply, we just resumed development on the scanner feature.

I can confirm that version 1.1.11 addresses the simulator issue and the camera permission workflow for iOS

I will proceed with closing this issue as well as https://github.com/Dynamsoft/capture-vision-react-native/issues/35

However, the TS conflict (https://github.com/Dynamsoft/capture-vision-react-native/issues/32) is still occurring. For now, we are re-patching this new version, but ideally the conflict should be addressed in the sdk typing definitions directly.

Thank you so much for looking into all these issues.