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

Does not compile with Swift 4 #162

Closed
ldiqual opened this Issue Jun 14, 2017 · 44 comments

Comments

Projects
None yet
@ldiqual

ldiqual commented Jun 14, 2017

I get the following errors when trying to compile with Swift 4:

Sources/Core/AppEvents/AppEvent.Builtin.swift:125:78: 'toUIntMax()' is unavailable
Sources/Core/AppEvents/AppEvent.Builtin.swift:239:68: 'toUIntMax()' is unavailable
Sources/Core/GraphRequest/GraphRequestProtocol.Bridge.swift:25:68: Closure tuple parameter '(key: String, value: Any)' does not support destructuring
@xisintag

This comment has been minimized.

Show comment
Hide comment
@xisintag

xisintag Jul 13, 2017

z0bur
I get the same errors. Did anyone found a replacement for toUIntMax() under Swift 4?

xisintag commented Jul 13, 2017

z0bur
I get the same errors. Did anyone found a replacement for toUIntMax() under Swift 4?

@zach-fuller

This comment has been minimized.

Show comment
Hide comment
@zach-fuller

zach-fuller Jul 17, 2017

"$0.toUIntMax() as UInt64" should be replaced with UInt64($0)

zach-fuller commented Jul 17, 2017

"$0.toUIntMax() as UInt64" should be replaced with UInt64($0)

@mortocks

This comment has been minimized.

Show comment
Hide comment
@mortocks

mortocks commented Jul 19, 2017

+1

4 similar comments
@Henriquedrdc

This comment has been minimized.

Show comment
Hide comment
@Henriquedrdc

Henriquedrdc commented Jul 21, 2017

+1

@imairi

This comment has been minimized.

Show comment
Hide comment
@imairi

imairi commented Jul 26, 2017

+1

@srea

This comment has been minimized.

Show comment
Hide comment
@srea

srea commented Jul 27, 2017

+1

@donpironet

This comment has been minimized.

Show comment
Hide comment
@donpironet

donpironet commented Aug 4, 2017

+1

@gbhall

This comment has been minimized.

Show comment
Hide comment
@gbhall

gbhall Aug 5, 2017

Is it fine to unlock the files and make the changes ourselves?

gbhall commented Aug 5, 2017

Is it fine to unlock the files and make the changes ourselves?

@Ged2323

This comment has been minimized.

Show comment
Hide comment
@Ged2323

Ged2323 Aug 12, 2017

Hello,

Has anyone had this error?

Cannot subscript a value of type 'String.UnicodeScalarView' with an index of type 'CountableRange<String.UnicodeScalarView.IndexDistance>' (aka 'CountableRange')

Thanks in advance for your help.

Ged2323 commented Aug 12, 2017

Hello,

Has anyone had this error?

Cannot subscript a value of type 'String.UnicodeScalarView' with an index of type 'CountableRange<String.UnicodeScalarView.IndexDistance>' (aka 'CountableRange')

Thanks in advance for your help.

@carlhung

This comment has been minimized.

Show comment
Hide comment
@carlhung

carlhung Aug 12, 2017

you mean this line?
cleaned[range].map(Character.init)

I want to fix this as well. which causes 'CountableRange<String.UnicodeScalarView.IndexDistance>' (aka 'CountableRange')

carlhung commented Aug 12, 2017

you mean this line?
cleaned[range].map(Character.init)

I want to fix this as well. which causes 'CountableRange<String.UnicodeScalarView.IndexDistance>' (aka 'CountableRange')

@carlhung

This comment has been minimized.

Show comment
Hide comment
@carlhung

carlhung Aug 12, 2017

I use this piece of code:
let substr = String(cleaned)
if substr.characters.count > 10 {
let endIndex = substr.index(substr.startIndex, offsetBy: 9)
return String(substr[substr.startIndex...endIndex])
} else {
return substr
}

to replace this piece:
let range = 0 ..< min(10, cleaned.count)
let characters = cleaned[range].map(Character.init)
return String(characters)

I don't know if it would work well.

carlhung commented Aug 12, 2017

I use this piece of code:
let substr = String(cleaned)
if substr.characters.count > 10 {
let endIndex = substr.index(substr.startIndex, offsetBy: 9)
return String(substr[substr.startIndex...endIndex])
} else {
return substr
}

to replace this piece:
let range = 0 ..< min(10, cleaned.count)
let characters = cleaned[range].map(Character.init)
return String(characters)

I don't know if it would work well.

@dmr07

This comment has been minimized.

Show comment
Hide comment
@dmr07

dmr07 Aug 26, 2017

Any updates on this?

dmr07 commented Aug 26, 2017

Any updates on this?

@hankchen1728

This comment has been minimized.

Show comment
Hide comment
@hankchen1728

hankchen1728 Aug 28, 2017

try this:
let range = String.Index(encodedOffset: 0) ..< String.Index(encodedOffset: min(10, cleaned.count))
to replace let range = 0 ..< min(10, cleaned.count)

Range of string subscript need to be 'Range<String.UnicodeScalarView.Index>',
but 0,10,and cleaned.count are 'Int'
Changing 'Int' to 'String.Index' may solve this

reference

hankchen1728 commented Aug 28, 2017

try this:
let range = String.Index(encodedOffset: 0) ..< String.Index(encodedOffset: min(10, cleaned.count))
to replace let range = 0 ..< min(10, cleaned.count)

Range of string subscript need to be 'Range<String.UnicodeScalarView.Index>',
but 0,10,and cleaned.count are 'Int'
Changing 'Int' to 'String.Index' may solve this

reference

@irace

This comment has been minimized.

Show comment
Hide comment
@irace

irace Sep 11, 2017

Is Facebook no longer maintaining this library?

irace commented Sep 11, 2017

Is Facebook no longer maintaining this library?

@gbhall

This comment has been minimized.

Show comment
Hide comment
@gbhall

gbhall Sep 11, 2017

I think Facebook don't work on prerelease software, as nothing is final yet and Apple could still make any change they want to.

gbhall commented Sep 11, 2017

I think Facebook don't work on prerelease software, as nothing is final yet and Apple could still make any change they want to.

@dpopov

This comment has been minimized.

Show comment
Hide comment
@dpopov

dpopov Sep 13, 2017

@gbhall XCode is in GM. So this is no longer "prerelease software"

dpopov commented Sep 13, 2017

@gbhall XCode is in GM. So this is no longer "prerelease software"

@tom-wolters

This comment has been minimized.

Show comment
Hide comment
@tom-wolters

tom-wolters Sep 18, 2017

So... Any update in sight?

tom-wolters commented Sep 18, 2017

So... Any update in sight?

@gbhall

This comment has been minimized.

Show comment
Hide comment
@gbhall

gbhall Sep 18, 2017

gbhall commented Sep 18, 2017

@jasonwedepohl

This comment has been minimized.

Show comment
Hide comment
@jasonwedepohl

jasonwedepohl commented Sep 20, 2017

+1

@julienfouilhe

This comment has been minimized.

Show comment
Hide comment
@julienfouilhe

julienfouilhe Sep 20, 2017

PR #169 would resolve the problem, any update on this? Thanks!

cc @nlutsenko

julienfouilhe commented Sep 20, 2017

PR #169 would resolve the problem, any update on this? Thanks!

cc @nlutsenko

@SunDog

This comment has been minimized.

Show comment
Hide comment
@SunDog

SunDog commented Sep 21, 2017

+1

@pedantix

This comment has been minimized.

Show comment
Hide comment
@pedantix

pedantix Sep 22, 2017

+1, because its the thing to do

pedantix commented Sep 22, 2017

+1, because its the thing to do

@Said-Re

This comment has been minimized.

Show comment
Hide comment
@Said-Re

Said-Re commented Sep 23, 2017

+1

1 similar comment
@francisykl-91

This comment has been minimized.

Show comment
Hide comment
@francisykl-91

francisykl-91 commented Sep 25, 2017

+1

@kristofk

This comment has been minimized.

Show comment
Hide comment
@kristofk

kristofk Sep 27, 2017

I collected all the errors and fixes and created this tutorial on compiling the Swift SDK in Swift 4

kristofk commented Sep 27, 2017

I collected all the errors and fixes and created this tutorial on compiling the Swift SDK in Swift 4

@grudev

This comment has been minimized.

Show comment
Hide comment
@grudev

grudev commented Sep 29, 2017

+1

4 similar comments
@ricardo0100

This comment has been minimized.

Show comment
Hide comment
@ricardo0100

ricardo0100 commented Sep 30, 2017

+1

@ethansinjin

This comment has been minimized.

Show comment
Hide comment
@ethansinjin

ethansinjin commented Oct 5, 2017

+1

@ppcat

This comment has been minimized.

Show comment
Hide comment
@ppcat

ppcat commented Oct 6, 2017

+1

@soponcv

This comment has been minimized.

Show comment
Hide comment
@soponcv

soponcv commented Oct 10, 2017

+1

@nbtolegenov

This comment has been minimized.

Show comment
Hide comment
@nbtolegenov

nbtolegenov commented Oct 10, 2017

+1

@julienfouilhe

This comment has been minimized.

Show comment
Hide comment
@julienfouilhe

julienfouilhe Oct 10, 2017

Guys, it's coming, see #184. Thanks to @gfosco for taking care of this!

We just have to wait for this to be merged.

julienfouilhe commented Oct 10, 2017

Guys, it's coming, see #184. Thanks to @gfosco for taking care of this!

We just have to wait for this to be merged.

@gfosco

This comment has been minimized.

Show comment
Hide comment
@gfosco

gfosco Oct 12, 2017

Contributor

0.3.0 is being published as we speak. :)

Contributor

gfosco commented Oct 12, 2017

0.3.0 is being published as we speak. :)

@ArsalanWahid

This comment has been minimized.

Show comment
Hide comment
@ArsalanWahid

ArsalanWahid Oct 22, 2017

Even 0.3.0 has the same errors and what made me find this thread

ArsalanWahid commented Oct 22, 2017

Even 0.3.0 has the same errors and what made me find this thread

@julienfouilhe

This comment has been minimized.

Show comment
Hide comment
@julienfouilhe

julienfouilhe Oct 22, 2017

@ArsalanWahid I don't have any problem with 0.3.0. What kind of errors do you have?

julienfouilhe commented Oct 22, 2017

@ArsalanWahid I don't have any problem with 0.3.0. What kind of errors do you have?

@vzaoral

This comment has been minimized.

Show comment
Hide comment
@vzaoral

vzaoral Oct 25, 2017

For me same error (0.3.0, Swift 4) - toUIntMax() obsoleted
EDIT: so I don't know what changed but after uninstalling and new installing pods everything works good...

vzaoral commented Oct 25, 2017

For me same error (0.3.0, Swift 4) - toUIntMax() obsoleted
EDIT: so I don't know what changed but after uninstalling and new installing pods everything works good...

@khoatd92

This comment has been minimized.

Show comment
Hide comment
@khoatd92

khoatd92 Oct 28, 2017

For me same error! Could anyone take a look on it please?
AppEvent.Builtin.swift:125:78: 'toUIntMax()' is unavailable

khoatd92 commented Oct 28, 2017

For me same error! Could anyone take a look on it please?
AppEvent.Builtin.swift:125:78: 'toUIntMax()' is unavailable

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost commented Oct 31, 2017

+1

@ppcat

This comment has been minimized.

Show comment
Hide comment
@ppcat

ppcat Nov 2, 2017

After performing pod update from 0.2.0 to 0.3.0. It works~

ppcat commented Nov 2, 2017

After performing pod update from 0.2.0 to 0.3.0. It works~

@gholias

This comment has been minimized.

Show comment
Hide comment
@gholias

gholias Nov 2, 2017

Cocoapods still cant find version 0.3.0

is there any solution to the problem?

gholias commented Nov 2, 2017

Cocoapods still cant find version 0.3.0

is there any solution to the problem?

@AlexandreRamos

This comment has been minimized.

Show comment
Hide comment
@AlexandreRamos

AlexandreRamos Nov 7, 2017

After running pod update, you will have the following information in your terminal:

Installing FBSDKCoreKit 4.27.1 (was 4.27.0)
Installing FBSDKLoginKit 4.27.1 (was 4.27.0)
Installing FBSDKShareKit 4.27.1 (was 4.27.0)
Installing FacebookCore 0.3.0 (was 0.2.0)
Installing FacebookLogin 0.3.0 (was 0.2.0)
Installing FacebookShare 0.3.0 (was 0.2.0)

AlexandreRamos commented Nov 7, 2017

After running pod update, you will have the following information in your terminal:

Installing FBSDKCoreKit 4.27.1 (was 4.27.0)
Installing FBSDKLoginKit 4.27.1 (was 4.27.0)
Installing FBSDKShareKit 4.27.1 (was 4.27.0)
Installing FacebookCore 0.3.0 (was 0.2.0)
Installing FacebookLogin 0.3.0 (was 0.2.0)
Installing FacebookShare 0.3.0 (was 0.2.0)

@julienfouilhe

This comment has been minimized.

Show comment
Hide comment
@julienfouilhe

julienfouilhe Nov 7, 2017

And don't forget to pod repo update to get the latest versions available. (cc @gholias)

julienfouilhe commented Nov 7, 2017

And don't forget to pod repo update to get the latest versions available. (cc @gholias)

@gholias

This comment has been minimized.

Show comment
Hide comment
@gholias

gholias Nov 8, 2017

I found out the problem, the 'FBSDKCoreKit' pod had a fixed old version that was blocking the usage of the version 0.3.0.

Everything is working now, thanks a lot for help.

gholias commented Nov 8, 2017

I found out the problem, the 'FBSDKCoreKit' pod had a fixed old version that was blocking the usage of the version 0.3.0.

Everything is working now, thanks a lot for help.

@Khodour

This comment has been minimized.

Show comment
Hide comment
@Khodour

Khodour Oct 17, 2018

Facebook should hair new iOS developers XD why this issue not yet fixed !!!

Khodour commented Oct 17, 2018

Facebook should hair new iOS developers XD why this issue not yet fixed !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment