HowTo: Start a New React Native Project with theta-client 1.12

I tested with a physical device camera, THETA X. I am using a router to provide Ethernet to my MacBook Air from my Internet WiFi. See TIP: MacBook Air Dual Network for Easier Development on Apple Silicon.

The THETA X can use 5GHz WiFi, which may be less sensitive to WiFi interference. The SC2 needs to use 2.4GHz.

@Phat_Ca I can replicate your error with theta-client 1.12 and fake-theta to this endpoint

https://fake-theta.vercel.app/osc/info

as far as I can tell, theta-client can’t work with https


Testing from physical Android phone connected to camera.

adb devices
npx react-native run-android --deviceId=YOUR_DEVICE_ID

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 26
        compileSdkVersion = 35
        targetSdkVersion = 34
        ndkVersion = "27.1.12297006"
        kotlinVersion = "1.9.10"
    }
    repositories {
        google()
        mavenCentral()
        flatDir {
            dirs 'libs'
        }
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
    }
}

apply plugin: "com.facebook.react.rootproject"

in app/build.gradle


dependencies {
    implementation fileTree(dir: "libs", include: ["*.aar"])

    // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android")

    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }
}

I have the theta-client aar file in android/libs

I also had to go through the installed module for theta-client and update for null checks.

  • Go to the error lines mentioned in your error message:
  • Line 311 in Converter.kt
  • Lines 305, 1893, and 2113 in ThetaClientSdkModule.kt
  • Fix the errors by ensuring you’re passing a non-null String where required.
1 Like