Search code examples
swift2xcode7alamofire

Playground Xcode : Failed to obtain sandbox extension


I am having this error message in my .playground file inside an IOS9 xcode project :

2015-10-28 16:28:45.159 Playground[83944:17501939] Failed to obtain sandbox extension for path=/var/folders/h7/cbc1x51x2rs7sjzfk0ndtxkr0000gp/T/com.apple.dt.Xcode.pg/containers/

What i have done is :

  1. Started a Xcode 7 / Swift 2 project
  2. Used "pod install Alamofire"
  3. Created a .playground file with this code :

import Alamofire

Alamofire.request(.GET, "http://httpbin.org/get" , parameters: ["foo": "bar"]).responseJSON { response in

        print(response.request)  // original URL request
        print(response.response) // URL response
        print(response.data)     // server data
        print(response.result)   // result of response serialization

        let str = response.data!

        if let JSON = response.result.value {
            print("JSON: \(JSON)")
        }
}

How can i test this library inside a .playground file without error ?


Solution

  • It seems like playground support have been dropped as of version 3 according to the owner:

    We removed the playground in the latest versions of Alamofire. Caused more problems than it was worth.

    Source: https://github.com/Alamofire/Alamofire/issues/368#issuecomment-158789746

    Unfortunately, to enable playground support you will have to downgrade Alamofire.