Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] App not working (crashing?!) on release build #43

Closed
Nurmehemmed opened this issue Apr 23, 2024 · 23 comments
Closed

[BUG] App not working (crashing?!) on release build #43

Nurmehemmed opened this issue Apr 23, 2024 · 23 comments
Labels
bug Something isn't working dependencies Related to a third-party dependency

Comments

@Nurmehemmed
Copy link

Nurmehemmed commented Apr 23, 2024

It doesnt work after build release apk and installed it on device

@Nurmehemmed Nurmehemmed added the question Further information is requested label Apr 23, 2024
@quangnd1910
Copy link

Me, not work on ios too, on release build

@Nurmehemmed Nurmehemmed changed the title [QUESTION] Did anyone build apk and test it on real device for v1.6? It doesnt work after build apk and download it to real device [QUESTION] Did anyone build apk and test it on real device for v1.6? It doesnt work after build release apk and download it to real device Apr 23, 2024
@quangnd1910
Copy link

image When I commented out runAsync, it worked

@luicfrr
Copy link
Owner

luicfrr commented Apr 23, 2024

The problem is in react-native-worklets-core context. On previous versions of it I could make a context creating workaround but on this new 1.1.1 version I can't do this anymore.

When I commented out runAsync, it worked

Removing runAsync will work but on slower devices you'll notice fps drops on camera preview.

I opened this issue on worklets-core repo. When it's solved I'll publish a new version with a fix

@luicfrr luicfrr changed the title [QUESTION] Did anyone build apk and test it on real device for v1.6? It doesnt work after build release apk and download it to real device [BUG] App not working (crashing?!) on release build Apr 23, 2024
@luicfrr luicfrr added bug Something isn't working dependencies Related to a third-party dependency and removed question Further information is requested labels Apr 23, 2024
luicfrr added a commit that referenced this issue Apr 23, 2024
@luicfrr
Copy link
Owner

luicfrr commented Apr 24, 2024

Please check 1.6.1 release

@Nurmehemmed
Copy link
Author

image
image
image
There are deprecated functions in your Camera.tsx component

@luicfrr
Copy link
Owner

luicfrr commented Apr 24, 2024

@Nurmehemmed did you checked release notes?

@Nurmehemmed
Copy link
Author

Sorry, i updated dependencies. Now i get Camera mount error. Trying to fix that.
Camera mount error [unknown/unknown: No supported surface combination is found for camera device - Id : 1. May be attempting to bind too many use cases. Existing surfaces: [] New configs: [androidx.camera.core.streamsharing.StreamSharingConfig@30d18ba, androidx.camera.core.impl.ImageAnalysisConfig@bf25e5, androidx.camera.core.impl.ImageCaptureConfig@827d0dc]]

@Nurmehemmed
Copy link
Author

i found. it is about i used format={format} in Camera component. It works now after delete it. But i have not format anymore

@luicfrr
Copy link
Owner

luicfrr commented Apr 25, 2024

I can confirm that original problem was solved on 1.6.1 version as it's working on builded (also store published) apps.

@luicfrr luicfrr closed this as completed Apr 25, 2024
@Nurmehemmed
Copy link
Author

Nurmehemmed commented Apr 25, 2024

@nonam4 maybe you used outdated version of vision-camera (4.0.0-beta.11) in 1.6.1 and so sorry but we cant implement solved vision-camera problems (in last vision-camera version) with your 1.6.1 package. For example i cant pass format prop now with your package Camera component. It throw error

@luicfrr
Copy link
Owner

luicfrr commented Apr 25, 2024

@Nurmehemmed you have some options then:

  • Use version 1.6.0: This version uses the most recent vision-camera and worklets-core versions, but as you said: "it crashes after releasing app". You may want to try following the vision-camera documentation instead of the recommended method.
  • Fix the package yourself: You can use patch-package to fix the issue. You can also open a PR with the fix, and you'll be credited for your contribution.
  • Create your own face-detection package: This option is more complex than it seems.

I created this package for my own project, and it's working very well on my released (and also store published) app. I made it open-source because there weren't any other updated packages available with the same functionality.

Since the package is open-source, you can use my code in any way you want, and I don't expect any payment for its use. However, I cannot dedicate more time to fixing an issue for which I haven't received any compensation, especially after exploring all possible solutions myself.

And as I said before: I opened this issue on worklets-core repo. When it's solved I'll publish a new version with a fix.

@Nurmehemmed
Copy link
Author

Sorry, I didn't want to hurt you) I appreciate your effort. Thanks!

@Sachin1116
Copy link

Sachin1116 commented Apr 25, 2024

@Nurmehemmed @nonam4 can you please try with this changes in Camera.tsx:

const cameraFrameProcessor = useFrameProcessor( ( frame ) => {
  'worklet'
  runAsync( frame, async () => {
    'worklet'
    const internal = frame as FrameInternal
    const faces = detectFaces( frame )

    // increment frame count so we can use frame on 
    // js side without frame processor getting stuck
    internal.incrementRefCount()
    try {
      await runOnJs(
        faces,
        frame
      )
    } catch (error) {
      console.log("lib error=>", error)
    } finally{
      internal.decrementRefCount()
    }

    // .finally( () => {
    //   // finally decrement frame count so it can be dropped
    //   internal.decrementRefCount()
    // } )
  } )
}, [ runOnJs ] )

With:

"react-native-vision-camera": "4.0.1",
"react-native-vision-camera-face-detector": "1.6.0"
"react-native-worklets-core": "1.1.1"

@luicfrr
Copy link
Owner

luicfrr commented Apr 25, 2024

@Sachin1116 did you test generating app APK and installing it on your device?

@Sachin1116
Copy link

yes its working fine in android

@luicfrr
Copy link
Owner

luicfrr commented Apr 25, 2024

What android version are you using and on wich devices did you tested?

@Sachin1116
Copy link

Sachin1116 commented Apr 25, 2024

Android 13 Samsung device and 14 one plus device

@Nurmehemmed
Copy link
Author

I checked it but doesnt work on prod in Samsung galaxy a22 (Android version 13)

@Sachin1116
Copy link

did you change library version
"react-native-vision-camera": "4.0.1",
"react-native-vision-camera-face-detector": "1.6.0"
"react-native-worklets-core": "1.1.1"

@Nurmehemmed
Copy link
Author

Of course

@SantoshYadavSridix
Copy link

Same issue on my end. Production build not working on Redmi 12 5g (Android 14) and Other Android Phones Redmi, Realme, etc with Android 12, 13, 14. I have not tested on 11 and below.

@Nurmehemmed
Copy link
Author

@SantoshYadavSridix check 1.6.1 version please. Problem solved there already. Please, dont forget to read release notes (You must change other dependency versions)

@luicfrr
Copy link
Owner

luicfrr commented May 3, 2024

I just released 1.6.2 version 🥳🎉 It is using latest vision-camera and worklets-core and it's not crashing on release mode. Can you please test it and give me a feedback? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Related to a third-party dependency
Projects
None yet
Development

No branches or pull requests

5 participants