0

Forgive me for a very general question but I am trying to get at the heart of how to update the aws sdk to support watchos which has proven to be a difficult and very lucrative (for developers) project. Apologies aside, here is my question.

The aws-sdk is a powerful library that provides sub-modules on iOS for interacting with aws services, however there is no support for watchos. When attempting to compile a workspace that has the aws-sdk ported to watchos, I received a compile time error.

Ld /Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Products/Debug-watchsimulator/AWSCore-watchOS/AWSCore.framework/AWSCore normal i386
    cd "/Users/osxuser/Documents/code/NTDI_Corporate/iwatch apps/AppName/Pods"
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export WATCHOS_DEPLOYMENT_TARGET=4.3
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator4.3.sdk -L/Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Products/Debug-watchsimulator/AWSCore-watchOS -F/Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Products/Debug-watchsimulator/AWSCore-watchOS -filelist /Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Intermediates.noindex/Pods.build/Debug-watchsimulator/AWSCore-watchOS.build/Objects-normal/i386/AWSCore.LinkFileList -install_name @rpath/AWSCore.framework/AWSCore -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mwatchos-simulator-version-min=4.3 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Intermediates.noindex/Pods.build/Debug-watchsimulator/AWSCore-watchOS.build/Objects-normal/i386/AWSCore_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -fapplication-extension -lsqlite3 -lz -framework CoreGraphics -framework Foundation -framework Security -framework SystemConfiguration -framework UIKit -framework CoreGraphics -framework Foundation -framework Security -framework SystemConfiguration -framework UIKit -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Intermediates.noindex/Pods.build/Debug-watchsimulator/AWSCore-watchOS.build/Objects-normal/i386/AWSCore_dependency_info.dat -o /Users/osxuser/Library/Developer/Xcode/DerivedData/AppName-fvzfbpyutkcifkaajtsobldxanrc/Build/Products/Debug-watchsimulator/AWSCore-watchOS/AWSCore.framework/AWSCore
> ld: framework not found SystemConfiguration

I am trying to get my imports right. The SystemConfiguration for watchos compilations fails. The problem seems to lie in the inclusion of the SystemConfiguration library here. How can I replace

#import <SystemConfiguration/SystemConfiguration.h>

line with something that would compile on watchos? Or for a more general question, how can a developer, like me, replace the SystemConfiguration library import on watchos projects that rely on it?

Here is my branch attempting to port the AWS SDK to not rely on SystemConfiguration.h.

Extra

The one library that seemed successful can be found here.

Victor 'Chris' Cabral
  • 2,135
  • 1
  • 16
  • 33

1 Answers1

0

Have you reviewed Apple’s documentation on the differences between watchOS and iOS support? I doubt that watchOS is a good platform for AWS integration, but that is just my personal thought after a quick review.

Have you looked at the Apple documentation for SystemConfiguration here? : https://developer.apple.com/documentation/systemconfiguration

Note that watchOS is not listed as supported. That is the initial cause of your problem. watchOS only supports WatchConnectivity framework at the current time, along with a limited web interface using NSURLConnection (I’m simplifying a little here.)

Any port to watchOS would need to replace any portions using connectivity monitoring and web connections with the more limited options available on watchOS. You will need to review all remote interactions in the AWS api to see if they can be accomplished with the limited features available on watchOS. For things that watchOS cannot do, it is possible to handoff functionality to the associated iOS app, in most cases. But you will also need to review that to see how it fits in to your app design.

Cobra
  • 369
  • 1
  • 6
  • I have reviewed apple's documentation about the SystemConfiguration and found the info you are mentioning. I looking for samples of how this has been effictively done (iphone/ipad library requiring SystemConfig that has been updated to work on watchos) – Victor 'Chris' Cabral May 21 '18 at 00:10
  • I have updated the question to include a good example of a project that converted to watchos https://github.com/AFNetworking/AFNetworking/commit/d184833fa015a783742b573cf48a3080b863a900 – Victor 'Chris' Cabral May 21 '18 at 04:24