ricohapi / theta-client

A library to control RICOH THETA
MIT License
18 stars 13 forks source link

Not able to Capture image from camera in release apk in flutter. #63

Closed kishanj918 closed 8 months ago

kishanj918 commented 10 months ago

I am calling below code to capture still image. This code works in dev mode but when i tested release apk it is throwing an exception.

 photoCapture.takePicture((fileUrl) {
    }, (exception) {
   // getting this error in release apk. works in dev mode.       

    // PlatformException(NotConnectedException, com.ricoh360.thetaclient.transferred.UnknownResponse cannot be cast to 
    // com.ricoh360.thetaclient.transferred.TakePictureResponse, null, null)
          });
simago commented 10 months ago

@kishanj918 I have confirmed to run demo-flutter in release mode without problems. Would you try to add "proguard-rules.pro" file to your application? Please see issue #33.

kishanj918 commented 10 months ago

@simago I have already added "proguard-rules.pro". I am getting same exception in the demo-flutter as well. Please see the attached video. It is not moving to next screen after capturing the image because of the exception.

https://github.com/ricohapi/theta-client/assets/3994657/a8103d6a-d07a-46b2-8324-d487d2812508

LassicYM commented 10 months ago

@kishanj918

Thanks for your comment.

Could you please output the complete error log from Android Studio or console and share it with us ?

Thank you very much.

kishanj918 commented 10 months ago

@LassicYM Sure. Here is the exception I am getting.

 PlatformException(NotConnectedException, com.ricoh360.thetaclient.transferred.UnknownResponse cannot be cast to 
  com.ricoh360.thetaclient.transferred.TakePictureResponse, null, null)
kishanj918 commented 9 months ago

@LassicYM Can you provide any updates on this? The resolution of this issue is crucial for me to proceed with the app release.

simago commented 9 months ago

@kishanj918 Please add following line to your "proguard-rules.pro" file. -keep class kotlinx.serialization.** { *; }

kishanj918 commented 9 months ago

@simago Thanks so much! It worked.