react-native-deepar icon indicating copy to clipboard operation
react-native-deepar copied to clipboard

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

Open javelwill opened this issue 10 months ago • 3 comments

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)

javelwill avatar Apr 20 '24 19:04 javelwill

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

AshishhIMG avatar Apr 22 '24 10:04 AshishhIMG

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

javelwill avatar Apr 23 '24 16:04 javelwill

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

Fang-dev73 avatar Jun 04 '24 20:06 Fang-dev73