-
Notifications
You must be signed in to change notification settings - Fork 29
Issues when converting Swift version to latest syntax #16
Comments
That's weird, you should not be getting prompted to update. I checked in a commit (4d1e48c) with the Swift 2 conversion earlier today. Make sure you've got the latest commits on the branch. |
Also, what exactly is the version number of Xcode you're using? I don't believe there's a release newer than 7.2 (7C68) which is what I have. I would not recommend using a beta Xcode if you're new to iOS development, especially if you're using Swift. |
7C68 is what I'm using. Just did the following steps: git clone git://github.com/couchbaselabs/Grocery-Sync-iOS.git cd Grocery-Sync-iOS-4 git checkout swift < double click GrocerySync.xcodeproj in Finder > Xcode launches and displays the "Convert to latest Swift syntax?" dialog. < Click on "Convert" > Xcode now says "Convert to Latest Swift Syntax has already been run. < Click cancel > < Copy in the CouchbaseLite framework > < Click "play" icon to build > Xcode displays as follows: attached < Click on "Update to recommended settings" > Xcode displays the changes it wants to make: attached < Click "update" > Xcode displays warning about "uncommitted changes": attached < Click continue > < Changes appear to be performed and warning clears > < Click build > Still have the errors: attached On Tue, Dec 29, 2015 at 1:57 AM, Jens Alfke [email protected]
|
That's bizarre. If you look at the commit, you can see that the project file includes Maybe you're double-clicking the project in the wrong folder, and that's a checkout that doesn't have the latest commits? |
Lots more smashing my head on this. Deleting everything, recloning, On Tue, Dec 29, 2015 at 1:07 PM, Jens Alfke [email protected]
|
Well, do a In Xcode, press Cmd-Shift-Opt K, or hold down the Option key and choose Product > Clean Build Folder. This will blow away any local state related to the project (object code, indexes, etc.) Then quit and relaunch Xcode. Open the About box to make sure you're running the copy of Xcode you think you are (I sometimes have a regular and a beta version around, and they're easy to mix up.) |
I just looked at the errors you get, and realized that we must have different versions of the CBL headers. That led me to discover that the CBL framework in my Grocery Sync checkout's Frameworks folder was not 1.1.1 but some older build — yikes! There were some changes in the API headers to produce a cleaner binding to Swift, and my source tree didn't have those. So I downloaded 1.1.1 and copied it into my GrocerySync folder, reproduced your build errors, fixed them, and checked in a new revision. So sorry about that :( It's easy to get versions mixed up because I switch between working on different branches all the time. I still don't understand why Xcode keeps wanting to upgrade the Swift syntax, but it should be harmless now that the build errors are gone. Crossing my fingers that it works for you now! |
Thanks for your continued interest in this. I hope that the work we're Here's what I did: Closed Xcode and cloned a fresh version of the code. On Tue, Dec 29, 2015 at 5:39 PM, Jens Alfke [email protected]
|
Weird, I don't get the update-settings suggestion either. But don't accept the changes unless you know what you're doing. Attachment didn't make it through. To capture a crash, click in the Xcode debugger console pane (the one with the |
2015-12-29 18:26:45.707 GrocerySync[2872:2179917] SYNC progress: 0 / 0 2015-12-29 18:26:45.711 GrocerySync[2872:2179917] SYNC progress: 0 / 0 2015-12-29 18:26:46.335 GrocerySync[2872:2179917] SYNC progress: 0 / 0 2015-12-29 18:27:11.301 GrocerySync[2872:2179917] SYNC progress: 0 / 0 2015-12-29 18:27:11.676 GrocerySync[2872:2179917] SYNC progress: 0 / 1 2015-12-29 18:27:22.578 GrocerySync[2872:2179917] 2015-12-29 18:27:22.579 GrocerySync[2872:2179917] ** Terminating app due *** First throw call stack: (0x23c1e2eb 0x233eadff 0x23c23ab5 0x23c2170f 0x23b50c88 0x27ded771 libc++abi.dylib: terminating with uncaught exception of type NSException _(lldb) _bt
*(lldb) * On Tue, Dec 29, 2015 at 6:35 PM, Jens Alfke [email protected]
|
The exception in there is: …OK, the button is wired up with an action string |
Thanks for all the help. On to getting a Couchbase Server and Sync Server On Tue, Dec 29, 2015 at 7:15 PM, Jens Alfke [email protected]
|
New set of problems. I have Couchbase server and Sync Gateway installed in an Ubuntu 14.04 VM. The IP address of the VM running the server and gateway is 192.168.1.12. I think I have followed all the directions. I modified the DemoAppDelegate.swift file as follows: (I originally had "http" instead of "https", but the application output an error about requiring a secure channel. That error cleared when I went to https.) The current error is as follows: |
I get the same timeout behavior with the Objective-C version of the app. One difference is that the Objective-C version does not require me to use https. |
But do you actually have SSL enabled on the Sync Gateway? If not, trying to make an SSL connection is definitely going to fail. You can override iOS App Transport Security and use regular HTTP by adding a key to your Info.plist. Check Apple's dev docs or google App Transport Security. --Jens |
Cloned this repo, checked out the "swift" branch, and copied the CouchbaseLite.framework into the Frameworks directory. On launching with the latest Xcode tools, the user is prompted to "update to the latest syntax", which I did. The update task completes, but the subsequent build fails (see below).
The text was updated successfully, but these errors were encountered: