Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Facebook SDK to 5.2.1 & 1.17.3 version bump #1424

Merged
merged 20 commits into from
Sep 8, 2019

Conversation

rico237
Copy link
Contributor

@rico237 rico237 commented Jul 6, 2019

Fix issue :

Fails to build for pod 'FBSDKCoreKit' #1411

@TomWFox
Copy link
Contributor

TomWFox commented Jul 6, 2019

@drdaz could you take a look at this?

@TomWFox
Copy link
Contributor

TomWFox commented Jul 6, 2019

@rico237 The CHANGELOG seems to have been abandoned but in the spirit of getting this SDK in better shape could you make an entry for 1.17.3. If you could follow the style in the Parse Server CHANGELOG that would be great.

@TomWFox TomWFox changed the title Update podspec for Facebook SDK 5.1.1 dependency #1411 Update podspec for Facebook SDK 5.1.1 dependency & 1.17.3 version bump Jul 6, 2019
@rico237
Copy link
Contributor Author

rico237 commented Jul 6, 2019

OK, btw Travis tests are not passing i will try to update my code later this weekend or next week so they can all pass

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

@TomWFox The changes look fine to me.

Either I'm blind, or I don't have the option to check this PR out; maybe it's because I'm not a 'Member' here. But I checked out @rico237's branch and ran the test suite, and it passed. Which is good.

I also integrated his branch in my own app and tried a login. It worked. Also good.

But it's weird that the Travis build fails. I'm not sure why that happened.

@TomWFox
Copy link
Contributor

TomWFox commented Jul 6, 2019

@drdaz If you are interested in contributing more I can ask the others about adding you to the org on the iOS team which would make things a bit easier.

I looked at the previous release and other files were changed such as the info.plist files to reflect the version bump, maybe that could be causing Travis to fail.

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

@TomWFox That might be a good idea, yeah.

I mean all @rico237's changes happened in his branch, including the version bump. I suspect this is related to the CI build process. This is the end of the build log from Travis:

▸ Compiling PFFacebookAuthenticationProvider.m
▸ Compiling PFFacebookUtils.m
▸ Compiling PFFacebookMobileAuthenticationProvider.m
❌  /Users/travis/build/parse-community/Parse-SDK-iOS-OSX/ParseFacebookUtils/ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.m:55:5: unknown type name 'FBSDKLoginManagerLoginResultBlock'; did you mean 'FBSDKLoginManagerLoginResult'?
    FBSDKLoginManagerLoginResultBlock resultHandler = ^(FBSDKLoginManagerLoginResult *result, NSError *error) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❌  /Users/travis/build/parse-community/Parse-SDK-iOS-OSX/ParseFacebookUtils/ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.m:55:39: interface type cannot be statically allocated
    FBSDKLoginManagerLoginResultBlock resultHandler = ^(FBSDKLoginManagerLoginResult *result, NSError *error) {
           ^
❌  /Users/travis/build/parse-community/Parse-SDK-iOS-OSX/ParseFacebookUtils/ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.m:55:39: initializing 'FBSDKLoginManagerLoginResult *' with an expression of incompatible type 'void (^)(FBSDKLoginManagerLoginResult *__strong, NSError *__strong)'
    FBSDKLoginManagerLoginResultBlock resultHandler = ^(FBSDKLoginManagerLoginResult *result, NSError *error) {
                                      ^
▸ Compiling PFFacebookPrivateUtilities.m
** BUILD FAILED **
The following build commands failed:
	CompileC /Users/travis/Library/Developer/Xcode/DerivedData/Parse-gllanltdbxaiviebocfvyncbwall/Build/Intermediates.noindex/ParseFacebookUtils.build/Release-iphoneos/ParseFacebookUtilsV4-iOS.build/Objects-normal/armv7/PFFacebookMobileAuthenticationProvider.o ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Failed to build framework for iphoneos.
The command "bundle exec rake package:release" exited with 1.
Done. Your build exited with 1.

Is there some way of just triggering a new build in there to see if it happens again?

@TomWFox
Copy link
Contributor

TomWFox commented Jul 6, 2019

@drdaz yep, I've restarted it

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

Same deal it seems :(

It looks like when it builds on Travis, the updated types from the new v5 SDK aren't there; so it's using the old version of the FB SDK.

The Cartfile still points at ~> 4.29 of the facebook-objc-sdk. That certainly needs to be updated, and seems like a possible source of the problem.

@rico237
Copy link
Contributor Author

rico237 commented Jul 6, 2019

I will make the change on the cartfile to see if that corrects this issue

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

🤞🏼

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

Sweet. We've got a new error:

❌  /Users/travis/build/parse-community/Parse-SDK-iOS-OSX/ParseFacebookUtils/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m:54:57: no visible @interface for 'FBSDKAccessToken' declares the selector 'initWithTokenString:permissions:declinedPermissions:expiredPermissions:appID:userID:expirationDate:refreshDate:dataAccessExpirationDate:'
    FBSDKAccessToken *token = [[FBSDKAccessToken alloc] initWithTokenString: accessToken permissions:@[] declinedPermissions:@[] expiredPermissions:@[] appID: [FBSDKSettings appID] userID: authData[@"id"] expirationDate: expirationDate refreshDate: nil dataAccessExpirationDate: nil];
                               ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Looks like the signature for the initialiser for FBSDKAccessToken changed, but the build is using the old version for some reason. In my checkout of @rico237's branch I can see a binary copy of the FBSDKCoreKit framework with the old signature for the initialiser.

Screenshot 2019-07-06 at 21 20 42

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

Looks like the signature for the initialiser for FBSDKAccessToken changed, but the build is using the old version for some reason. In my checkout of @rico237's branch I can see a binary copy of the FBSDKCoreKit framework with the old signature for the initialiser.

Looks like that was temporary. We're back to the same error again.

@rico237
Copy link
Contributor Author

rico237 commented Jul 6, 2019

May I had you @drdaz as a collaborator to my branch/fork ?

I will work on those errors as well but maybe you have a better experience than I have and fix those before me ...

@drdaz
Copy link
Member

drdaz commented Jul 6, 2019

@rico237 Sure. I'm not sure I'll be faster than you here though :)

@rico237
Copy link
Contributor Author

rico237 commented Jul 6, 2019

I'm still a junior ios dev.
i'm new to tests, the experience I have on testing is "Well, it works on my machine so ..." 😆

@drdaz
Copy link
Member

drdaz commented Jul 7, 2019

So I've found the cause for the current build issue; in the ParseFacebookUtils project, there's a build phase (script) called 'Fetch Latest Dependencies'. It grabs a zip file from FB's servers - https://origincache.facebook.com/developers/resources/?id=facebook-ios-sdk-current.zip. This zip file contains a version 4.29 of the FB libs.

The 2 FBSDK files (Core, Login) end up used in the ParseFacebookUtils project, in Frameworks/User Frameworks/Static/iOS/. I've tried removing the build phase and just copying the files from Carthage/Build in their place, but this doesn't seem to work. Probably dynamic vs static frameworks at play here.

@rico237
Copy link
Contributor Author

rico237 commented Jul 7, 2019

Ok i see the problem here xD

There is the official Facebook releases
Link

I think you can try with this link for statics frameworks
Link for 5.1.1

@drdaz
Copy link
Member

drdaz commented Jul 7, 2019

Way ahead of you :)

The iOS version releases for me now. Getting tvOS working.

@rico237
Copy link
Contributor Author

rico237 commented Jul 7, 2019

xD im gonna try in my project too 😮

@mrmarcsmith
Copy link

@drdaz good question. I’ll try to make time today to check the Carthage bug.

@mrmarcsmith
Copy link

@drdaz Carthage is still failing but it looks like your fork is actually a fork of "tamir-maoz/Parse-SDK-iOS-OSX" which is a fork of "parse-community/Parse-SDK-iOS-OSX" and the tamir-maoz repo is 3 commits behind master. Do you have access to update the "tamir-maoz/Parse-SDK-iOS-OSX"?

Here is the one liner I use to test carthage.

mkdir test && cd test/ && echo 'github "rico237/Parse-SDK-iOS-OSX" "master"' > Cartfile && carthage update && rm -rf test

it failed with the following error:

*** Fetching Parse-SDK-iOS-OSX
*** Fetching facebook-objc-sdk
*** Fetching Bolts-ObjC
*** Checking out Parse-SDK-iOS-OSX at "5ec75d324e28bec32a787dcc0f06d0aa58485e0a"
*** Checking out Bolts-ObjC at "1.9.0"
*** Checking out facebook-objc-sdk at "v5.4.0"
*** xcodebuild output can be found in /var/folders/4h/lmd6v14934l7pk19__x7x4wc0000gn/T/carthage-xcodebuild.fx31Rq.log
*** Downloading facebook-objc-sdk.framework binary at "Facebook SDK v5.4.0"
*** Building scheme "Bolts-tvOS" in Bolts.xcodeproj
*** Building scheme "Bolts-iOS" in Bolts.xcodeproj
*** Building scheme "Bolts-macOS" in Bolts.xcodeproj
*** Building scheme "Bolts-iOS-Dynamic" 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-tvOS" in Parse.xcworkspace
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -workspace /Users/marcsmith/MMProjects/45-Cleanio/cleanio-ios\ copy/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse.xcworkspace -scheme Parse-tvOS -configuration Release -derivedDataPath /Users/marcsmith/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/Parse-SDK-iOS-OSX/5ec75d324e28bec32a787dcc0f06d0aa58485e0a -sdk appletvos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/4h/lmd6v14934l7pk19__x7x4wc0000gn/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/marcsmith/MMProjects/45-Cleanio/cleanio-ios copy/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/4h/lmd6v14934l7pk19__x7x4wc0000gn/T/carthage-xcodebuild.fx31Rq.log

    /bin/sh -c /Users/marcsmith/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/Parse-SDK-iOS-OSX/5ec75d324e28bec32a787dcc0f06d0aa58485e0a/Build/Intermediates.noindex/ArchiveIntermediates/Parse-tvOS/IntermediateBuildFilesPath/Parse.build/Release-appletvos/Parse-tvOS.build/Script-815F22B21BD04D150054659F.sh
extractLocStrings: error: input file copy/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse/Parse/Resources/en.lproj cannot be read in Unicode (UTF-8) encoding
find: copy/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse/Parse: No such file or directory
extractLocStrings: error: input file copy/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse/Parse/Resources/en.lproj cannot be read in Unicode (UTF-8) encoding

** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution Generate\ Localizable\ Strings /Users/marcsmith/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/Parse-SDK-iOS-OSX/5ec75d324e28bec32a787dcc0f06d0aa58485e0a/Build/Intermediates.noindex/ArchiveIntermediates/Parse-tvOS/IntermediateBuildFilesPath/Parse.build/Release-appletvos/Parse-tvOS.build/Script-815F22B21BD04D150054659F.sh
(1 failure)

@drdaz
Copy link
Member

drdaz commented Aug 18, 2019

@mrmarcsmith Something fishy is going on here 🥴 When I run your one-liner, I don't get that error.

What stands out to me in your error output is the path; copy/Carthage/Checkouts/Parse-SDK-iOS-OSX/Parse/Parse doesn't seem like the right place to be looking when your one-liner creates a directory called 'test' where all the checking out and building happens. Perhaps something is going on with your $PROJECT_DIR environment variable where you're running this? Does that path actually exist relative to where you are running the one-liner?

I do get another error, however, later in the process while building ParseFacebookUtilsV4-iOS-Dynamic. I'll look into that one.

Screenshot 2019-08-18 at 22 58 14

I tried this a couple times, the second time deleting DerivedData. Results were the same.

@mrmarcsmith
Copy link

@drdaz do you have access to the tamir-maoz repo to update it? I think that might fix it.

@drdaz
Copy link
Member

drdaz commented Aug 18, 2019

No I don’t, just Rico.

But I don’t understand why I’m not seeing the same issue? We should be running the same code?

Is there a specific commit you think will fix it?

@drdaz
Copy link
Member

drdaz commented Aug 19, 2019

@mrmarcsmith Looking at the latest 3 commits here, this is the only one which changes any code (the others are documentation changes): 4a82099

I don't believe this change would have an effect on the Carthage build.

@markuswinkler
Copy link
Contributor

any news? Is it safe to use this branch?

@rico237
Copy link
Contributor Author

rico237 commented Aug 27, 2019

@markuswinkler I think it is safe to use that branch since the main changes are just the version number of the libs used by the Parse SDK, the thing is we are having issues with the tests in circleci (local tests seems to be passing most of the time).

To keep the project as clean and bug free as possible those tests need to pass before merging this branch. (this is the only reason why this branch as not been merged yet)

@drdaz
Copy link
Member

drdaz commented Aug 27, 2019

@markuswinkler There are also issues with the Carthage build. If you don't use Carthage to install, you should be fine.

@TomWFox
Copy link
Contributor

TomWFox commented Aug 27, 2019

To be clear we can merge with the tests not passing (they haven’t been for months) it’s the Carthage build which is more concerning.

@drdaz
Copy link
Member

drdaz commented Aug 27, 2019

@TomWFox Can you try running @mrmarcsmith's one-liner at some point and see where / if it fails for you?

EDIT: Here's hoping it's not a third place 🤞🏼

@drdaz
Copy link
Member

drdaz commented Sep 1, 2019

So a little update here. I just spent some time trying to figure out why this fork wasn't building with Carthage.

I tried the same one-liner against an older commit, before we started doing all the things. It still failed.

I tried against the main repo at master, and it still fails. I used this line:

mkdir test && cd test/ && echo 'github "https://github.com/parse-community/Parse-SDK-iOS-OSX/" "master"' > Cartfile && carthage update

So... whatever the problem is, it doesn't really look to me like the source is from this fork.

With that said, I still haven't been able to reproduce the issue @mrmarcsmith mentioned - my build fails when compiling ParseFacebookUtils-*-Dynamic. @TomWFox (EDIT: or anybody else) can you try running this Carthage build command and see if / where you fail? It would be nice to have some consensus on the actual state of things here.

EDIT2: The main repo fails for me in the same place (ParseFacebookUtils-*-Dynamic) but with a different error. sigh

@mrmarcsmith
Copy link

As previously mentioned I got Carthage build working in my fork of your repo here maybe you could compare forks to see what’s breaking your Carthage build

This would be the one liner mkdir test && cd test/ && echo 'github "https://github.com/panda-clouds/Parse-SDK-iOS-OSX/" "master"' > Cartfile && carthage update

For rollback of separation of dynamic and static builds
@drdaz
Copy link
Member

drdaz commented Sep 2, 2019

@mrmarcsmith Thanks for that. Carthage builds now.

I feel a little silly; we even discussed the relevant change in your review. 🥴 But at least we got there.

@drdaz
Copy link
Member

drdaz commented Sep 2, 2019

My goodness I think we're there. Unless there are any objections?

@drdaz
Copy link
Member

drdaz commented Sep 2, 2019

Actually, these pointers look like they need updating too: https://github.com/parse-community/Parse-SDK-iOS-OSX/tree/master/Carthage/Checkouts

Does anybody know if / where they're used?

@mrmarcsmith
Copy link

Those dependencies are used in the Parse-SDK-iOS-OSK framework itself. For example, Bolts is the framework that allows us to use in-line asynchronous callbacks. I would leave them for now since we really need to get this PR released and they aren’t hurting anything. You can open a new PR that bumps them to keep the repo fresh though!

@markuswinkler
Copy link
Contributor

Is there a specific reason why the Facebook SDK will be locked down to 5.2.1?
It's already at 5.5.0 and it's very likely that there will be critical updates once iOS 13 is out.

@drdaz
Copy link
Member

drdaz commented Sep 8, 2019

@markuswinkler it shouldn't be locked to that. We're using the ~> notation in the dependency managers.

If you use this fork in Cocoapods or Carthage, you'll get FB SDK 5.5.0.

@drdaz drdaz merged commit 804d5bf into parse-community:master Sep 8, 2019
@drdaz
Copy link
Member

drdaz commented Sep 8, 2019

Aaaand merged. Finally :)

@drdaz drdaz mentioned this pull request Sep 8, 2019
@drdaz
Copy link
Member

drdaz commented Sep 8, 2019

... the merge seems to have broken so many tests.

sigh

@drdaz
Copy link
Member

drdaz commented Sep 8, 2019

Re-ran the tests on CI. All green except macOS 👌🏼

@markuswinkler
Copy link
Contributor

Tried to run pod update on from one. Still limits to 5.2.1.
Can we please change the dependency from
s.dependency 'FBSDKLoginKit', '~> 5.2.1'
s.dependency 'FBSDKTVOSKit', '~> 5.2.1'
s.dependency 'FBSDKShareKit', '~> 5.2.1'
to
s.dependency 'FBSDKLoginKit', '~> 5.x'
s.dependency 'FBSDKTVOSKit', '~> 5.x'
s.dependency 'FBSDKShareKit', '~> 5.x'
?
Just tried it with 5.5.0, FB login works like a charm.

@drdaz
Copy link
Member

drdaz commented Sep 9, 2019

@markuswinkler Just pushed a couple changes that loosen the FB deps for both Carthage and Cocoapods.

I actually did test this before claiming we weren't locked in, but FB Core got installed at v5.5.0 and confused me (we don't specify a version for FB Core) 😊

@drdaz
Copy link
Member

drdaz commented Sep 9, 2019

Those dependencies are used in the Parse-SDK-iOS-OSK framework itself. For example, Bolts is the framework that allows us to use in-line asynchronous callbacks. I would leave them for now since we really need to get this PR released and they aren’t hurting anything. You can open a new PR that bumps them to keep the repo fresh though!

@mrmarcsmith Just getting back to this, I'm confused as to why these mismatched dependencies aren't causing trouble if they're actually being used. They're API incompatible at this point.

Just trying to figure out how all this is strung together really 😊. It's weird to me that we have those submodules defined where they're going to get overwritten by Carthage.

@AliZahr
Copy link

AliZahr commented Sep 30, 2019

Anyone facing issue with Facebook Login? What's happening is that when I sign in through facebook, after a while I get Invalid Session Token error on queries I do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants