File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
android/src/main/java/com/mrousavy/camera/react Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,8 @@ class CameraDevicesManager(private val reactContext: ReactApplicationContext) :
5959
6060 override fun getName (): String = TAG
6161
62- override fun initialize () {
63- super .initialize()
64- cameraManager.registerAvailabilityCallback(callback, null )
62+ // Init cameraProvider + manager as early as possible
63+ init {
6564 coroutineScope.launch {
6665 try {
6766 Log .i(TAG , " Initializing ProcessCameraProvider..." )
@@ -76,6 +75,12 @@ class CameraDevicesManager(private val reactContext: ReactApplicationContext) :
7675 }
7776 }
7877
78+ // Note: initialize() will be called after getConstants on new arch!
79+ override fun initialize () {
80+ super .initialize()
81+ cameraManager.registerAvailabilityCallback(callback, null )
82+ }
83+
7984 override fun invalidate () {
8085 cameraManager.unregisterAvailabilityCallback(callback)
8186 super .invalidate()
You can’t perform that action at this time.
0 commit comments