Not able to control smart lock after successful connection in android using sdk.

App development related product technical discussions, including OEM App, App SDK, device control interface development, mini program development and other topics.


Post Reply
pratham
Posts: 1

After successful connection with smart lock using AP pairing method, not able to unlock the device using self developed android app using sdk.
Able to receive the remote unlock request from device but after allowing to the request I'm getting success in api response but the device is not unlock.

android > build.gradle file
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 35
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
}
repositories {
jcenter()
maven { url 'https://maven-other.tuya.com/repository/maven-releases/' }
maven { url "https://maven-other.tuya.com/repository ... -releases/" }
maven { url 'https://jitpack.io' }
google()
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://central.maven.org/maven2/' }
maven { url 'https://oss.sonatype.org/content/reposi ... snapshots/' }
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven-other.tuya.com/repository/maven-releases/' }
maven { url "https://maven-other.tuya.com/repository ... -releases/" }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://central.maven.org/maven2/' }
maven { url 'https://oss.sonatype.org/content/reposi ... snapshots/' }
maven { url 'https://developer.huawei.com/repo/' }
}
}

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

android > app > build.gradle
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

react {


Code: Select all

autolinkLibrariesWithApp()

}

def enableProguardInReleaseBuilds = false

def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'

android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

Code: Select all

namespace "com.demolock.in"
defaultConfig {
    applicationId "com.demolock.in"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 1
    versionName "1.0"
     ndk {
     abiFilters "armeabi-v7a", "arm64-v8a"
    }
}
 packagingOptions {
  pickFirst 'lib/*/libc++_shared.so' // An Android Archive (AAR) file contains an Android library. If the .so file exists in multiple AAR files, select the first AAR file.

}


Code: Select all

signingConfigs {
    debug {
        storeFile file('debug.keystore')
        storePassword 'android'
        keyAlias 'androiddebugkey'
        keyPassword 'android'
    }
}
buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        // Caution! In production, you need to generate your own keystore file.
        // see https://reactnative.dev/docs/signed-apk-android.
        signingConfig signingConfigs.debug
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    }
}

}

configurations.all {
exclude group: "com.thingclips.smart" ,module: 'thingsmart-modularCampAnno'
}

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

Code: Select all

if (hermesEnabled.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}
implementation fileTree(dir: 'libs', include: ['*.aar'])

implementation ('com.alibaba:fastjson:1.1.67.android')
implementation ('com.squareup.okhttp3:okhttp-urlconnection:3.14.9')

// The latest stable App SDK for Android.
implementation ('com.facebook.soloader:soloader:0.10.4')
implementation ('com.thingclips.smart:thingsmart:6.2.2')
implementation ('com.thingclips.smart:thingsmart-lock-sdk:6.0.1')
implementation ('com.thingclips.smart:thingsmart-ipcsdk:6.2.0')

// React Native dependencies
implementation("com.facebook.react:react-android")


Code: Select all

// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation ('com.google.code.gson:gson:2.8.9')
   
// Add other React Native dependencies
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") 
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")

}

Post Reply