expo: [expo-camera][Android] app use camera crash occasionally (may be face detector related)

Summary

I use expo-camera and wrote code as follows, with expo-dev-client, app will crash occasionally and log is : Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNllParameter, parameter settings

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

44.0.1

Environment

Expo CLI 5.0.3 environment info: System: OS: macOS 12.0.1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.17.1 - ~/.nvm/versions/node/v14.17.1/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v14.17.1/bin/yarn npm: 6.14.13 - ~/.nvm/versions/node/v14.17.1/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 IDEs: Android Studio: 3.6 AI-192.7142.36.36.6392135 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: ~0.16.2 => 0.16.14 babel-preset-expo: 9.0.1 => 9.0.1 expo: ~44.0.1 => 44.0.1 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: expo-cli: 5.0.3 Expo Workflow: bare

Reproducible demo

`<View style={{ flexDirection: ‘column’, backgroundColor: GlobalConstant.whiteColor, borderTopStartRadius: 40, borderTopEndRadius: 40, alignItems: “center”, height: ‘100%’, paddingVertical: ‘10%’, }}> <View style={[ styles.circleView, { borderColor: “#f7c7f3”, borderWidth: 10, width: 620, height: 620, borderRadius: 400, } ]}> <View style={[ styles.circleView, { borderColor: “#7F56DD”, borderWidth: 6, width: 600, height: 600, overflow: ‘hidden’, borderRadius: 400, }

                ]}>
                    <Camera
                        style={{
                            width: 240,
                            height: 330,
                        }}
                        type={type}
                        ref={camera}
                        onMountError={mountCameraError}
                    />
                </View>


            </View>
        </View>`

const styles = StyleSheet.create({ circleView: { backgroundColor: "transparent", alignItems: "center", justifyContent: "center", }, titleText: { color: "#000000", marginVertical: 5, fontFamily: "SourceHanSansSC-Normal", }, })

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 14
  • Comments: 22 (3 by maintainers)

Most upvoted comments

It’s happening whenever the app goes in background or minimized. Reopening from menu or unlocking, exactly this error is coming up. Any update on this issue?

It seems there is some bug at ExpoCameraView.kt:

       val faceDetectorProvider: FaceDetectorProviderInterface by moduleRegistry()
          faceDetector = faceDetectorProvider.createFaceDetectorWithContext(context)
          pendingFaceDetectorSettings.let {
           faceDetector?.setSettings(it)
           pendingFaceDetectorSettings = null
          }

I delete lines of code above, my app works well and never crash, I guess there is some bug about face detection, but I never use face detection in my app.

Any help is appreciate