TwitterKit sharing fail on iPhone5S (iOS8.4), but fine work simulator iPhone 5S (8.4)


#1

I tried to share some string and image on my application. Sharing success on iPhone 6(9.3), and simulator iPhone 5S(8.4, 9.3).

But I failed sharing on iPhone 5S(iOS 8.4)

There are my code and crashes.

  • Code:

let composer = TWTRComposer()
let postMessage = "Twitter sharing test"
let viewController = UIApplication.sharedApplication().keyWindow?.rootViewController!

composer.setText(postMessage)
composer.setImage(UIImage(named: “Twitter_Icon”))

composer.showFromViewController(viewController!) { result in
if (result == TWTRComposerResult.Cancelled) {

}    
else {    
}  

}

  • Crash:
    2016-07-11 06:49:40.923 airdropTest[1600:294752] [Fabric] Unable to locate application icon
    2016-07-11 06:49:40.971 airdropTest[1600:294752] [Crashlytics] Version 3.7.2 (112)
    2016-07-11 06:50:05.645 airdropTest[1600:294752] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Application tried to present a nil modal view controller on target .’ * First throw call stack: (0x18554c22c 0x1971c80e4 0x18a2ea898 0x18a2ec734 0x18a0b5f40 0x1001c8af4 0x1001014a8 0x100101574 0x18a6ae7f4 0x18a2ceab0 0x18a2d0f2c 0x18a0eadb8 0x18a00055c 0x18a0000c4 0x189ffffcc 0x18990962c 0x100b2cf94 0x100b31c28 0x185503544 0x1855015ec 0x18542cf74 0x18ee8f6fc 0x18a02ed94 0x100107a08 0x197872a08)
    libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

#2

Hey @johannes_bakker,

Can you share a bit more of your code, which version of TwitterKit you’re running and a full exception please?

Thanks,
Mike


#3

Hi bonnell
Thanks for your help.
I send my source.
Source Url : "https://www.dropbox.com/sh/jhfiyhhwv2hovf6/AADHNxjz3mEhDmT5UMx8OyN8a?dl=0"
TwitterKit

|
|
|
| | |

|

|
|
| |
TwitterKit
Shared with Dropbox | |

|

|

There are TwitterKit version as following.- Crashlytics (3.7.2): - Fabric (~> 1.6.3) - Fabric (1.6.7) - TwitterCore (2.3.0): - Fabric - TwitterKit (2.3.0): - TwitterCore (= 2.3.0)

  • Crash2016-07-16 02:12:58.978 airdropTest[3665:895008] [Fabric] Unable to locate application icon 2016-07-16 02:12:59.015 airdropTest[3665:895008] [Crashlytics] Version 3.7.2 (112) 2016-07-16 02:13:49.064 airdropTest[3665:895008] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Application tried to present a nil modal view controller on target <UINavigationController: 0x144509290>.’ *** First throw call stack: (0x18554c22c 0x1971c80e4 0x18a2ea898 0x18a2ec734 0x18a0b5f40 0x100104af4 0x10003d468 0x10003d534 0x18a6ae7f4 0x18a2ceab0 0x18a2d0f2c 0x18a0eadb8 0x18a00055c 0x18a0000c4 0x189ffffcc 0x18990962c 0x100a60f94 0x100a65c28 0x185503544 0x1855015ec 0x18542cf74 0x18ee8f6fc 0x18a02ed94 0x100043a08 0x197872a08) libc++abi.dylib: terminating with uncaught exception of type NSException

It fine work on iPhone 6(iOS9.3), simulator of iPhone 5S(9.3, 8.4).But failed on iPhone 5S (iOS 8.4)
Regards.Johannes


#4

Hi Michael.
Now I’m in China.So china’s users can’t go into twitter site without VPN.
Regards.Johannes


#5

Hi Michael.

And I didn’t set twitter account on iPhone Settings.
You can see the Setting image that I published.
Regards.Johannes


#6

I got this crash too, iPhone 10.3.1, twitter kit is 1.15.3(2.8.1 is not working too).