question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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", }, })

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:14
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
sadi304commented, Jan 19, 2022

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?

3reactions
chinamcafeecommented, Dec 25, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo Camera Crashes with onFacesDetected option on ...
expo app keeps crashing whenever I navigated to the camera component. am using expo sdk 43, and this happens on expo custom dev...
Read more >
Camera app crash while taking photos (Iphone 13 ,15.4.1)
Sometime when i try to take photo , camera app goes black after i press capture button, like full black screen( not showing...
Read more >
Detect and diagnose crashes - Android Developers
If your app is experiencing crashes, you can use the guidance in this page to diagnose and fix the problem. Detect the problem....
Read more >
Face ID Not Working or Not Available on Your iPhone? Here ...
Alternatively, you can see the complete list of apps that have requested Face ID access by going to Settings > Face ID &...
Read more >
Known issues | ML Kit - Google Developers
For bundled Language ID, the app may crash when upgrading to AGP 7.0.0 or later. ... for FaceDetection API since com.google.mlkit:face-detection:16.0.5 and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found