Ricoh theta integration with Flutter

When ricoh theta sdk was integrated with a flutter mobile app the app fails from getting built. Same app has no issues when run on ios devices but when run on android it gives an error. how can i resolve this. the error code shown is given below.
Picked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8
Picked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8

Picked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8

Picked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:amplify_db_common:compileDebugJavaWithJavac’.

error: invalid source release: 17

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 2m 3s
Running Gradle task ‘assembleDebug’… 129.4s
Error: Gradle task assembleDebug failed with exit code 1

Please confirm you are using theta-client 1.10.0 and the problem is occurring with the build to Android.

Yes that is the version i am using and the problem is occurring with the build to android.

image

take picture with live preview working

image listing

image view

comand line

using flutter run -d

craig@craigs-air demo-flutter % flutter run -d 9AXXXXXXXXXX

no errors

using branch 1.10.0

craig@craigs-air demo-flutter % git branch -a                
* (HEAD detached at origin/dev/1.10.0)
  main
  remotes/origin/HEAD -> origin/main
  remotes/origin/dev/1.10.0
  remotes/origin/dev/1.3.0

using android studio koala

image

using Sonoma 14.5

image

output of flutter doctor -v

craig@craigs-air demo-flutter % flutter doctor -v
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale
    en-US)
    • Flutter version 3.22.3 on channel stable at /Users/craig/bin/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b0850beeb2 (2 weeks ago), 2024-07-16 21:43:41 -0700
    • Engine revision 235db911ba
    • Dart version 3.4.4
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/craig/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/craig/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.11+0-17.0.11b1207.24-11852314)

[✓] IntelliJ IDEA Community Edition (version 2023.3.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.90.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

Successful Test with Android

I also tried running the demo-flutter on an Android simulator and was successfully able to display the app on the simulator. I’m using the Flutter version 3.22.3 on a Mac version Sonoma 14.6. I’m also using the Pixel Fold simulator on Android 15.

To run the application, I used my Mac’s home internet connection. I ran the command flutter run -d emulator-5554 which opened up the Android simulator with the Plugin example app. After the application showed up, I disconnected my Mac’s internet connection and connected it to the WiFi from the Theta X camera, allowing it to connect to the camera.

The terminal shows that the demo works as expected:

I tested the Take Picture, File List, and Capture Video command which appeared to work appropriately.


Successful Test with IOS

The demo-flutter also works on an iOS simulator as expected. I used the iPhone 15 simulator on version 17.5 and went through the same process to run the device on iOS.



2 Likes

Adding panorama_viewer

flutter pub add panorama_viewer

live preview

screen_capture_vysor-ezgif.com-gif-to-webp-converter

                  : PanoramaViewer(
                      child: Image.memory(
                        frameData,
                        errorBuilder: (a, b, c) {
                          return Container(
                            color: Colors.black,
                          );
                        },
                        gaplessPlayback: true,
                      ),
                    ),

image

  body: Container(
            alignment: Alignment.center,
            child: PanoramaViewer(child: Image.network(
              fileUrl,
              loadingBuilder: (context, child, loadingProgress) {
                if (loadingProgress == null) return child;
                return const Text('loading...');
              },
              errorBuilder: (a, b, c) {
                return Container(
                  color: Colors.white,
                );
              },

image_360_view

Development Environment

flutter, Android SDK, Android Studio, OS

[craig@archmini ~]$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on Arch Linux 6.10.2-arch1-1, locale C.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.1)
[✓] Connected device (3 available)
[✓] Network resources                

• No issues found!
[craig@archmini ~]$ 

Using theta-client version 1.10.0

This last test done with Arch Linux on the desktop.

Previous two tests were down on MacOS (two different computers).

No problems on the three computers we tested.

Suggest you reinstall Android Studio and the Android SDK and use the version of Java from Android Studio. If problem persists, show the output of flutter doctor -v