parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 871 forks source link

ParseFacebookUtilsV4-iOS not compiling #1463

Closed craiggrummitt closed 5 years ago

craiggrummitt commented 5 years ago

Attempting to add Parse-SDK-iOS-OSX (ver 1.16.0) to a new Xcode (ver 11.1) project via Carthage (ver 0.34.0). After phase: "*** Building scheme "ParseFacebookUtilsV4-iOS" in Parse.xcworkspace" I encountered the error: "Build Failed Task failed with exit code 65:"

Screenshot 2019-10-24 12 17 19

If I open the Parse.xcworkspace and try to build to the ParseFacebookUtilsV4-iOS scheme, I think I see the problem: "Localizable.strings:1:1: could not decode input file using specified encoding: Unicode (UTF-8), and the file contents appear to be encoded in Unicode (UTF-16)"

Screenshot 2019-10-24 12 10 39
drdaz commented 5 years ago

This has been fixed in more recent versions. Try updating to the current version of the SDK (1.17.3) and see if that doesn't help.

craiggrummitt commented 5 years ago

Thanks for the tip @drdaz . So ver 1.16.0 was the version that downloaded via Carthage, would you recommend I follow the "Compiling for yourself" instructions in "Getting Started" instead?

drdaz commented 5 years ago

I wouldn't; you should be able to get the current version using Carthage. Maybe try specifying the version manually in the Cartfile... although if you don't specify a version, it should get the latest.

craiggrummitt commented 5 years ago

Yes, that's why I was confused, my cartfile consists of: github "parse-community/Parse-SDK-iOS-OSX"

I ran it minutes ago, and I saw this amongst other things in the Terminal:

*** Downloading Parse-SDK-iOS-OSX.framework binary at "1.16.0"

I updated the cartfile to:

github "parse-community/Parse-SDK-iOS-OSX" == 1.17.3

And I see the following in the Terminal:

*** Fetching Parse-SDK-iOS-OSX
*** Fetching facebook-objc-sdk
A shell task (/usr/bin/env git fetch --prune --quiet https://github.com/facebook/facebook-objc-sdk.git refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/dependencies/facebook-objc-sdk)) failed with exit code 1

In case, I changed == 1.17.3 to >= 1.17.0 and I still get a failure with exit code 1.

drdaz commented 5 years ago

I can't reproduce your issue locally unfortunately. When I run carthage update using a Cartfile with just our dependency (and without version number), it gets the current version.

Try deleting the Carthage cache (rm -rf /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/) and anything in the Carthage folder of your project, where it downloads and does it's work. Maybe that'll help 🤞🏼

Even more unfortunately, the build fails for me when building Parse-macOS using Carthage. So this is lots of fun.

drdaz commented 5 years ago

Phew. Fixed my build issue. Never put spaces in folder names. Apparently I haven't learned that enough times yet. 🤦🏽‍♂️

That doesn't fix your problem however. Aside from removing the cache and Carthage folders, also delete your project's Cartfile.resolved file. This really should work; it builds here:

Darrens-MacBook-Pro:untitled folder drdaz$ carthage update
Please update to the latest Carthage version: 0.34.0. You currently are on 0.33.0
*** Fetching Parse-SDK-iOS-OSX
*** Fetching Bolts-ObjC
*** Fetching facebook-objc-sdk
*** Checking out Parse-SDK-iOS-OSX at "1.17.3"
*** Checking out facebook-objc-sdk at "v5.8.0"
*** Checking out Bolts-ObjC at "1.9.0"
*** xcodebuild output can be found in /var/folders/l7/psfs7tdn0nbbcw2hy5fysmfc0000gn/T/carthage-xcodebuild.U8WbK4.log
*** Downloading facebook-objc-sdk.framework binary at "Facebook SDK v5.8.0"
*** Downloading Parse-SDK-iOS-OSX.framework binary at "1.17.3"
*** Building scheme "Bolts-macOS" in Bolts.xcodeproj
*** Building scheme "Bolts-tvOS" in Bolts.xcodeproj
*** Building scheme "Bolts-iOS-Dynamic" in Bolts.xcodeproj
*** Building scheme "Bolts-iOS" in Bolts.xcodeproj
*** Building scheme "Bolts-tvOS-Dynamic" in Bolts.xcodeproj
*** Building scheme "Bolts-watchOS" in Bolts.xcodeproj
*** Building scheme "Bolts-watchOS-Dynamic" in Bolts.xcodeproj
*** Building scheme "Parse-macOS" in Parse.xcworkspace
*** Building scheme "Parse-tvOS" in Parse.xcworkspace
*** Building scheme "Parse-iOS-Dynamic" in Parse.xcworkspace
*** Building scheme "Parse-iOS" in Parse.xcworkspace
*** Building scheme "Parse-watchOS" in Parse.xcworkspace
*** Building scheme "Parse-watchOS-Dynamic" in Parse.xcworkspace
*** Building scheme "Parse-tvOS-Dynamic" in Parse.xcworkspace
*** Building scheme "ParseFacebookUtilsV4-iOS" in Parse.xcworkspace
*** Building scheme "ParseFacebookUtilsV4-tvOS" in Parse.xcworkspace
*** Building scheme "ParseFacebookUtilsV4-tvOS-Dynamic" in Parse.xcworkspace
*** Building scheme "ParseFacebookUtilsV4-iOS-Dynamic" in Parse.xcworkspace
*** Building scheme "ParseTwitterUtils-iOS" in Parse.xcworkspace
*** Building scheme "ParseTwitterUtils-iOS-Dynamic" in Parse.xcworkspace
*** Building scheme "ParseUI" in Parse.xcworkspace
*** Building scheme "ParseUI-Dynamic" in Parse.xcworkspace
Darrens-MacBook-Pro:untitled folder drdaz$
craiggrummitt commented 5 years ago

Thanks again for your help with this @drdaz. I have done the following:

  1. I followed your instructions to delete the Carthage cache: rm -rf /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/
  2. Rather than following your advice to delete the Carthage folder in my project, I actually created a brand new Xcode project (just to make doubly sure that there could be nothing residual from previous attempts)
  3. I then created a Cartfile that contains simply: github "parse-community/Parse-SDK-iOS-OSX"
  4. I opened the Terminal, and ran: carthage update --platform ios Here is the entire terminal log I see:
    
    *** Cloning Parse-SDK-iOS-OSX
    *** Cloning facebook-objc-sdk
    *** Cloning Bolts-ObjC
    *** Checking out Parse-SDK-iOS-OSX at "1.17.3"
    *** Checking out Bolts-ObjC at "1.9.0"
    *** Checking out facebook-objc-sdk at "v5.8.0"
    *** xcodebuild output can be found in /var/folders/24/sm_t4ts908v6ddc9gplvn8rh0000gn/T/carthage-xcodebuild.dDxKeu.log
    *** Downloading facebook-objc-sdk.framework binary at "Facebook SDK v5.8.0"
    *** Downloading Parse-SDK-iOS-OSX.framework binary at "1.17.3"
    *** Building scheme "Bolts-iOS" in Bolts.xcodeproj
    *** Building scheme "Bolts-iOS-Dynamic" in Bolts.xcodeproj
    *** Building scheme "Parse-iOS-Dynamic" in Parse.xcworkspace
    *** Building scheme "Parse-iOS" in Parse.xcworkspace
    Build Failed
    Task failed with exit code 65:
    /usr/bin/xcrun xcodebuild -workspace /Users/craiggrummitt/Development/iOS/PlayXcode11/TestParse2/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse.xcworkspace -scheme Parse-iOS -configuration Release -derivedDataPath /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.17.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/24/sm_t4ts908v6ddc9gplvn8rh0000gn/T/Parse-SDK-iOS-OSX SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/craiggrummitt/Development/iOS/PlayXcode11/TestParse2/Carthage/Checkouts/Parse-SDK-iOS-OSX)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/24/sm_t4ts908v6ddc9gplvn8rh0000gn/T/carthage-xcodebuild.dDxKeu.log


Interestingly, this time it **is** downloading version 1.17.3. However, I am still seeing the same error 65. 

5. However! This time when I open `Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse.xcworkspace` and try to build the `ParseFacebookUtilsV4-iOS` scheme, I do not see the same error as I saw in my initial post.

6. So, I took a closer look at the log file mentioned in the Terminal log. Whereas the original log file said:

Localizable.strings... error: could not decode input file using specified encoding: Unicode (UTF-8), and the file contents appear to be encoded in Unicode (UTF-16) (in target 'ParseFacebookUtilsV4-iOS' from project 'ParseFacebookUtils')

ARCHIVE FAILED

The following build commands failed: CopyStringsFile /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.16.0/Build/Intermediates.noindex/ArchiveIntermediates/ParseFacebookUtilsV4-iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ParseFacebookUtilsV4.framework/Localizable.strings /Users/craiggrummitt/Development/iOS/PlayXcode11/TestParse/Carthage/Checkouts/Parse-SDK-iOS-OSX/ParseFacebookUtils/Resources/Localizable.strings


The new logfile says:

Libtool /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.17.3/Build/Intermediates.noindex/ArchiveIntermediates/Parse-iOS/IntermediateBuildFilesPath/Parse.build/Release-iphoneos/Parse-iOS.build/Objects-normal/arm64/Parse normal arm64 cd /Users/craiggrummitt/Development/iOS/PlayXcode11/TestParse2/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse export IPHONEOS_DEPLOYMENT_TARGET=8.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only arm64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk -L/Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.17.3/Build/Intermediates.noindex/ArchiveIntermediates/Parse-iOS/BuildProductsPath/Release-iphoneos -filelist /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.17.3/Build/Intermediates.noindex/ArchiveIntermediates/Parse-iOS/IntermediateBuildFilesPath/Parse.build/Release-iphoneos/Parse-iOS.build/Objects-normal/arm64/Parse.LinkFileList -o /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.17.3/Build/Intermediates.noindex/ArchiveIntermediates/Parse-iOS/IntermediateBuildFilesPath/Parse.build/Release-iphoneos/Parse-iOS.build/Objects-normal/arm64/Parse

ARCHIVE FAILED

The following build commands failed: Libtool /Users/craiggrummitt/Library/Caches/org.carthage.CarthageKit/DerivedData/11.1_11A1027/Parse-SDK-iOS-OSX/1.17.3/Build/Intermediates.noindex/ArchiveIntermediates/Parse-iOS/IntermediateBuildFilesPath/Parse.build/Release-iphoneos/Parse-iOS.build/Objects-normal/armv7/Parse normal armv7 (1 failure)



I see that you are not able to replicate the issue, so the question is what the difference might be between our systems. 
Could you confirm what version of Xcode you're running? I'm using Xcode 11.1.

I also see that you have the message "Please update to the latest Carthage version: 0.34.0. You currently are on 0.33.0". I am on Carthage 0.34.0. I see in the [Carthage release notes](https://github.com/Carthage/Carthage/releases) that 0.34.0 has "Additional workarounds to enable Xcode 11.0" too, so I suspect if you're running 0.33.0 without a problem you might be on Xcode 10?
drdaz commented 5 years ago

Interesting. My error was also 65. And my fix was getting rid of the space in the path to my project. But that doesn't look like it's the case for you.

I actually have both Xcode 10 and 11 installed still. I have no idea which my build was using. But I've just installed the Carthage update and rebuilt. Same result, and it built using Xcode 11.

The only difference I can see is that I'm not adding --platform ios to my update command. That really shouldn't make a difference though.

I just noticed, your logs suggest you're running Xcode 11.1 though, and you're compiling against iOS 13.1. These are both pre-release / beta. Now there's a difference. I suspect if you drop back to the release version of Xcode that it'll work.

EDIT: I didn't directly answer, and you actually wrote that you're running 11.1. Sorry.

But I'm running release versions on this machine. So 11.0. Pretty sure that'll be it, without knowing exactly why.

craiggrummitt commented 5 years ago

Hi @drdaz actually Xcode 11.1 is the latest release of Xcode and includes Swift 5.1 and support for iOS 13.1.

Screenshot 2019-10-24 21 11 30

It was released 7th of October. link

I just realized I have Xcode 11.0 installed on another computer, so I tested adding Parse there and it worked! I'd love to install Xcode 11.1 there for diagnostic purposes to see if that's the reason Parse isn't working, but first I'm going to do what I can on the project I'm working on on that machine while it's working!

drdaz commented 5 years ago

Oh wow. For some reason this update doesn't notify in the App Store for me. So I just assumed I had the latest release...

craiggrummitt commented 5 years ago

I think we can close this issue, I've tested adding Parse using Carthage on two machines with Xcode 11.1, and then updated to Xcode 11.2 and it still works.

Don't know what resolved the problem to be honest. One possibility - I was using Catalina 15.1 beta and am now using non-beta Catalina 15.1, possibly that caused an issue?