ricohapi / theta-client

A library to control RICOH THETA
MIT License
15 stars 11 forks source link

Flutter demo release build - can't initialize #33

Closed jcasman closed 1 year ago

jcasman commented 1 year ago

The apk built with flutter build apk can't initialize the connection to the camera, gets "initialize error" - I'm using demo-flutter with no changes. Google Pixel 4 running Android 13. With THETA X. Firmware 2.10.1.

This works in debug with no problem. I only have the problem when I build for release and distribution.

Screenshot_20230622-160936

Screenshot_20230622-160949

simago commented 1 year ago

@jcasman Thank you for your defect report. I confirm "initialize error" in release mode.

To fix this error:

  1. Add file "proguard-rules.pro" to "theta-client/demos/demo-flutter/android/app/", which content is following:
    -keep class com.ricoh360.thetaclient.** { *; }
  2. Add following property proguardFiles to "theta-client/demos/demo-flutter/android/app/build.gradle":

    
    android {
    buildTypes {
    release {
    
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    
    }
    }
    }


We will fix this defect in the next release.
jcasman commented 1 year ago

This fix worked. Thank you!