0

I'm trying to utilize Amazon's AWSiOSSDKv2.framework in my Swift Application.

I've set up the SDK like Amazon's docs suggest.

Now, I'm trying to get started with S3; I'm following along with the README, but at step 4 I get the immensely frustrating SourceKitService Terminated message and syntax highlighting is removed. The project does not compile and gives this error (254):

Command /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254

My objective_c_bridge.h:

#import <AWSiOSSDKv2/AWSCore.h>
#import <AWSiOSSDKv2/S3.h>
#import <AWSiOSSDKv2/DynamoDB.h>
#import <AWSiOSSDKv2/SQS.h>
#import <AWSiOSSDKv2/SNS.h>

My AppDelegate didFinishWithLaunching method:

func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
    let yourAccessKey = "some_access_key" //obviously not what I use
    let yourSecretKey = "some_secret_key" //obviously not what I use
    let credentialsProvider = AWSStaticCredentialsProvider.credentialsWithAccessKey(yourAccessKey, secretKey: yourSecretKey) //causes error
    let defaultServiceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider)
    AWSServiceManager.defaultServiceManager().setDefaultServiceConfiguration(defaultServiceConfiguration)
    return true
}

Commenting out the fourth/fifth line resolves the problem but obviously I cannot use the framework then. There is nothing out of the ordinary in my code (I made a new project and the only code I've written I've pasted). I obviously plan on not hard coding the access and secrets keys but I'm just trying to get things rolling/compile right now...

Edit: Everything works fine in Xcode-Beta 2, but in Xcode-Beta 3, this occurs

Thanks for any feedback

Ryan
  • 195
  • 2
  • 14
  • 1
    Congratulations on finding a Swift compiler bug! I've found for this particular kind of problem (where it's failing to interact with a C API) the best workaround is to write a bit of Objective-C code to do what was failing in Swift, that you can then just call from Swift at the required time. – Nate Cook Jul 20 '14 at 06:18
  • How do I go about reporting this bug to Apple, given it's revealed through an external API (I was under the initial impression this is an issue in Amazon's API). Secondly, assuming this is a Swift bug, how would you proceed in writing this code in objective-C as this is Amazon's API? Should I write a function that basically does the same thing as these couple lines in Objective C and include a reference to that file in my bridge header? Today's my first day dealing with bridges so excuse me for asking a question I think is obvious (I just don't want to go down the wrong path). Thanks Nate – Ryan Jul 20 '14 at 09:35
  • https://bugreport.apple.com/ – drhr Oct 28 '14 at 16:00

0 Answers0