ridvanaltun / react-native-deepar

Snapchat-like filters, AR lenses, and real-time facial animations.
https://deepar.ai
MIT License
127 stars 17 forks source link

App crashes on Android with java.lang.IllegalStateException: DeepAR not yet initialized! #44

Open javelwill opened 6 months ago

javelwill commented 6 months ago

Hello, I am currently working on an app that crashes on startup with the error below. Could anyone provide insights on what might be causing this error? Any help would be greatly appreciated. Thank you!

Your app just crashed. See the error below. java.lang.IllegalStateException: DeepAR not yet initialized! Can't call this method before the DeepAR is initialized. ai.deepar.ar.DeepAR.checkValidState(DeepAR.java:662) ai.deepar.ar.DeepAR.receiveFrame(DeepAR.java:680) com.reactnativedeepar.CameraXHandler$1$1.analyze(CameraXHandler.java:112) androidx.camera.core.ImageAnalysis.lambda$setAnalyzer$2(ImageAnalysis.java:476) androidx.camera.core.ImageAnalysis$$ExternalSyntheticLambda2.analyze(Unknown Source:2) androidx.camera.core.ImageAnalysisAbstractAnalyzer.lambda$analyzeImage$0$androidx-camera-core-ImageAnalysisAbstractAnalyzer(ImageAnalysisAbstractAnalyzer.java:285) androidx.camera.core.ImageAnalysisAbstractAnalyzer$$ExternalSyntheticLambda1.run(Unknown Source:14) android.os.Handler.handleCallback(Handler.java:942) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:226) android.os.Looper.loop(Looper.java:313) android.app.ActivityThread.main(ActivityThread.java:8741) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

AshishhIMG commented 6 months ago

hey @javelwill you found the solution ?? , m also stuck on this issue

javelwill commented 6 months ago

Hey @AshishhIMG I couldn't pinpoint the source of the error, but it started working for me after I closely followed the example provided in the repository

Fang-dev73 commented 4 months ago

Instead of giving width and height in percentage, give it in pixels or using Dimensions it will start working

hey @javelwill you found the solution ?? , m also stuck on this issue