FAQ

Last Updated on : 2023-05-09 02:14:06download

Version issues

1. Why cannot Application Loader be found in Xcode 11?

Starting Xcode 11, Application Loader is unavailable. Apple has launched a new tool to upload .ipa files. You can install the Transporter tool from App Store to upload .ipa files.

2. Why has an error occurred while running the command pod install?

CocoaPods 1.3.0 or later must be used. You can check the version by running pod --version.

3. The error message CDN: trunk Repo update failed / trunk URL couldn't be downloaded is returned when pod install is run. How do I deal with this problem?

By default, CocoaPods 1.8.0 uses the CDN Repo source. For more information, see CocoaPods documentation.

If you cannot access the source due to network conditions, you can edit the Podfile and restore the source to Master Repo.

- source 'https://cdn.cocoapods.org/'
+ source 'https://github.com/CocoaPods/Specs.git'

4. For iOS 12, [[TuyaSmartActivator sharedInstance] currentWifiSSID] cannot return a valid Wi-Fi service set identifier (SSID). How do I deal with this problem?

For Xcode 10, required permissions must be granted to return Wi-Fi information. Solution: Set Access WiFi Information to ON at Xcode > [Project Name] > Targets > [Target Name] > Capabilities.

FAQ

5. What is new in SDK permissions updated for iOS 13?

For more information, see iOS Version Adaptation.

6. After the SDK is updated to v2.8.0 or later, the app crashes during SDK initialization. How do I deal with this problem?

Starting SDK v2.8.0, the security image verification is required and AppKey and AppSecret are updated. For these SDK versions, if your app crashes and the error message Terminating app due to uncaught exception 'start sdk error', reason: 'security image not found' is returned, go to the Tuya IoT Development Platform and generate the files required for SDK initialization. For more information, see Preparation.

SDK issues

1. The device does not report status after a control command is sent. How do I deal with this problem?

Check whether the data types of device data points (DPs) are correct. For example, a DP of Value type can be sent in the format of @{@"2": @(25)} rather than @{@"2": @"25"}.

2. How do I enable the debug mode and print the debug logs?

After SDK initialization, run the following code:

[[TuyaSmartSDK sharedInstance] setDebugMode:YES];

3. A push certificate has been uploaded for an SDK-based app. Why cannot push notifications be received on the app?

  1. Make sure that Push Notification is enabled in Xcode.
  2. Log in to the Tuya IoT Development Platform and upload the push certificate.
  3. Call the didFinishLaunchingWithOptions API method to initialize the Push method.
  4. Log in to the Tuya IoT Development Platform and go to the Marketing push page.

For more information, see Integrate with Push Notifications.

4. Why does the SDK return English, rather than the mobile phone system language, as the local language?

The SDK returns a local language based on [[NSBundle mainBundle] preferredLocalizations]. You must configure the multilingual display settings in your project.

5. Does the SDK support control of infrared devices?

Currently, the SDK does not support control of infrared devices.

6. Multiple DPs are sent in the same device control command, but no device status is reported. How do I deal with this problem?

Before multiple DPs are sent, check whether a conflict might occur between these DPs. We recommend that you send DPs without a conflict in the same command. For example, to control a lighting device:

  • The brightness and color temperature DPs can be combined.
  • The switch, brightness, and color temperature DPs cannot be combined in the same command. Otherwise, this problem will occur.

7. If the Bluetooth feature is not required, can I remove the dependency on the Bluetooth module of the SDK to minimize the package size?

Yes, you can. In this case, only the device pairing and control features are required. Only the following dependencies are required:

# Capabilities to manage homes, devices, rooms, and groups
pod 'TuyaSmartDeviceKit',
# Capabilities of device pairing
pod 'TuyaSmartActivatorKit',

You can reference the following modules as needed:

# Bluetooth Low Energy (LE) capabilities
pod 'TuyaSmartBLEKit',
# Capabilities of `sigMesh`
pod 'TuyaSmartBLEMeshKit',
# Capabilities of smart scenes
pod 'TuyaSmartSceneKit',
# Capabilities of scheduled tasks for devices and groups
pod 'TuyaSmartTimerKit',
# Capabilities of Message Center
pod 'TuyaSmartMessageKit',
# Capabilities of feedback
pod 'TuyaSmartFeedbackKit',

SDK running errors

1. The error message Undefined symbols xxx is returned during the integration with the SDK. How do I deal with this problem?

In most cases, this error is caused by inconsistent versions among different SDK components.

Make sure that each referenced library uses a consistent version number, in which the major and minor versions are the same. For example, v3.12.1 and v3.12.5 are consistent. If not, run pod update to update the version and recompile the code.

2. The error message Error Domain=NSURLErrorDomain Code=-999 "Canceled" is returned after an API method of the SDK is called. How do I deal with this problem?

Make sure that the object in the API request is a global variable, for example, self.feedBack = [[TuyaSmartFeedback alloc] init];. Otherwise, it will be released earlier than expected.

3. How do I deal with a signature error?

Make sure that bundleId, appKey, appSecret, and the security image are consistent with those used on the Tuya IoT Development Platform. Any mismatch will cause the authentication to be failed. For more information, see Preparation.

4. The error message library not found for -XXX is returned during sample compilation. How do I deal with this problem?

Make sure that you have opened the project .xcworkspace rather than .xcproject.

5. Why has the error Undefined symbols for architecture arm64 occurred when I used a Mac with M1 chip to compile my project for iOS?

Error code sample:

Undefined symbols for architecture arm64:
"OBJC_CLASS$TYAudioEngine", referenced from:
objc-class-ref in TuyaSpeechKit(TuyaSpeechVADetector.o)
"OBJC_CLASS$TuyaSceneIntent", referenced from:
objc-class-ref in TYSiriShortcutModule(TYSceneShortcutManager.o)
"OBJC_CLASS$_DWKWebView", referenced from:
objc-class-ref in TYHybridContainer(TYHybridContainerVC.o)
ld: symbol(s) not found for architecture arm64.

Solution:

Perform the following steps for troubleshooting:

  1. Add the following code block to the Podfile:

    post_install do |installer|
    	installer.pods_project.build_configurations.each do |config|
    		config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    	end
    end
    
  2. Open your project in Xcode, choose Build Settings > Excluded Architectures, and then add the option Any iOS Simulator SDK with the value arm64.

  3. Run pod install.