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

Crash on jailbroken iPod Touch 6G #9

Closed
allaire opened this issue Sep 1, 2016 · 59 comments
Closed

Crash on jailbroken iPod Touch 6G #9

allaire opened this issue Sep 1, 2016 · 59 comments

Comments

@allaire
Copy link
Contributor

allaire commented Sep 1, 2016

Got the following crash:

iPod Touch 6G on 9.3.3

Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x000000010170847c

Crashed: com.apple.main-thread
0  SwiftMessages                  0x10170847c IconStyle.image(theme : Theme) -> UIImage (Theme.swift:37)
1  ios                            0x1000fccdc static MessageManager.showInfo(String, body : String) -> () (MessageManager.swift:71)
2  UIKit                          0x18783d944 -[UIPresentationController transitionDidFinish:] + 1320
3  UIKit                          0x18796e418 -[_UICurrentContextPresentationController transitionDidFinish:] + 44
4  UIKit                          0x187840b3c __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 188
5  UIKit                          0x187611114 -[_UIViewControllerTransitionContext completeTransition:] + 116
6  UIKit                          0x187610f00 -[UITransitionView notifyDidCompleteTransition:] + 252
7  UIKit                          0x1876109fc -[UITransitionView _didCompleteTransition:] + 1164
8  UIKit                          0x18761055c -[UITransitionView _transitionDidStop:finished:] + 124
9  UIKit                          0x18751bc28 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 312
10 UIKit                          0x18751bab0 -[UIViewAnimationState animationDidStop:finished:] + 108
11 QuartzCore                     0x184e75998 CA::Layer::run_animation_callbacks(void*) + 284
12 libdispatch.dylib              0x181dd547c _dispatch_client_callout + 16
13 libdispatch.dylib              0x181ddab84 _dispatch_main_queue_callback_4CF + 1844
14 CoreFoundation                 0x182340d50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
15 CoreFoundation                 0x18233ebb8 __CFRunLoopRun + 1628
16 CoreFoundation                 0x182268c50 CFRunLoopRunSpecific + 384
17 GraphicsServices               0x183b50088 GSEventRunModal + 180
18 UIKit                          0x18754a088 UIApplicationMain + 204
19 ios                            0x1000ec280 main (AppDelegate.swift:24)
20 libdyld.dylib                  0x181e068b8 start + 4```
@wtmoose
Copy link
Member

wtmoose commented Sep 1, 2016

Guessing it can't find the framework's resource bundle. Are you on the latest version? There was a recent fix that might be related #2. Otherwise, could you provide some context around how you're building (e.g. Cocoa pods, Carthage, etc.)? I'd like to be able to reproduce the problem on my end.

@allaire
Copy link
Contributor Author

allaire commented Sep 1, 2016

Hi @wtmoose!

Thanks for the quick reply!

I'm using SwiftMessages (1.1.2) with CocoaPods.

So far this crash happened once with a user, can't reproduce using an iPhone or iPad on my end.

@wtmoose
Copy link
Member

wtmoose commented Sep 1, 2016

Gotcha. Hmm. Thanks for reporting. I'll look into it, though I'm at the try! Swift NYC conference for a couple of days. How are you building the library (e.g. Cocoa pods, Carthage, etc.)?

@wtmoose
Copy link
Member

wtmoose commented Sep 1, 2016

As a workaround, you could copy the image into your project and write your own config method that sets the image instead of having SwiftMessages set it.

@allaire
Copy link
Contributor Author

allaire commented Sep 1, 2016

I built the library with CocoaPods, using Fastlane.

The library works great, and the alerts show on the App Store version on my iPhone 6. Maybe it is isolated to iPod Touch?

@wtmoose
Copy link
Member

wtmoose commented Sep 1, 2016

Are you on CocoaPods 1.0.1?

@allaire
Copy link
Contributor Author

allaire commented Sep 1, 2016

Yep!

 $ pod --version
1.0.1

@wtmoose
Copy link
Member

wtmoose commented Sep 6, 2016

Any idea if the device in question was jailbroken? Just asking because #12 is reporting a similar-sounding issue and the device in question is jailbroken.

@allaire
Copy link
Contributor Author

allaire commented Sep 6, 2016

Hi @wtmoose,

Thanks for the follow up.

Yes, 100% jailbreak according to Fabric 👍

@wtmoose wtmoose changed the title Crash on iPod Touch 6G Crash on jailbroken iPod Touch 6G Sep 7, 2016
@allaire
Copy link
Contributor Author

allaire commented Oct 11, 2016

@wtmoose Any hint on why it crashes on Jailbroken device?

@wtmoose
Copy link
Member

wtmoose commented Oct 11, 2016

No. I don't have a jailbroken device. I've been waiting for a kind jailbreaker to drop in and help out. Got close with #12, but I never heard back.

Do you have any data on percentage of users affected?

@allaire
Copy link
Contributor Author

allaire commented Oct 11, 2016

@wtmoose Yes, 100% of my JB users are experiencing this crash.

I don't have a JB device as well :(

@wtmoose
Copy link
Member

wtmoose commented Oct 11, 2016

Do you have a percentage of all users affected?

@allaire
Copy link
Contributor Author

allaire commented Oct 11, 2016

@wtmoose just JB users

This was referenced Oct 12, 2016
@wtmoose
Copy link
Member

wtmoose commented Oct 17, 2016

Minor update: we tried to pin down a jailbroken device last week, with no luck. None of our devices are on a version of 9.x or 10.x that can be jailbroken.

We did try a "partially" jailbroken 9.4 device, but couldn't reproduce the crash. If and when the latest version of 10.x is jailbroken, we'll give that a try. Beyond that, I'm not sure what else can be done until someone with a jailbroken device lends a hand.

You can probably work around the issue by copying the .nib file into your project and removing or changing the image referenced by the image view.

@kwstasna
Copy link

Still jailbroken device iPhone 6s on 9.3.3 crash on your library.

Crashed: com.apple.main-thread
0  SwiftMessages                  0x1009b5e88 _TFO13SwiftMessages9IconStyle5imagefT5themeOS_5Theme_CSo7UIImage + 1556
1  SwiftMessages                  0x1009a1654 _TFC13SwiftMessages11MessageView14configureThemefTOS_5Theme9iconStyleOS_9IconStyle_T_ + 28
2  Events Near Me                 0x100089c1c specialized locationViewController.showAlertCancel() -> () + 4295121948
3  Events Near Me                 0x100086f60 locationViewController.(getData((Resulty<()>) -> ()) -> ()).(closure #1) (locationViewController.swift)
4  Alamofire                      0x1003501e8 _TTSg5GV9Alamofire22DataResponseSerializerP__GS0_P__S_30DataResponseSerializerProtocolS____TFFFC9Alamofire11DataRequest8responseuRxS_30DataResponseSerializerProtocolrFT5queueGSqCSo13DispatchQueue_18responseSerializerx17completionHandlerFGVS_12DataResponsewx16SerializedObject_T__DS0_U_FT_T_U_FT_T_ + 232
5  libdispatch.dylib              0x1811a14bc _dispatch_call_block_and_release + 24
6  libdispatch.dylib              0x1811a147c _dispatch_client_callout + 16
7  libdispatch.dylib              0x1811a6b84 _dispatch_main_queue_callback_4CF + 1844
8  CoreFoundation                 0x18170cd50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9  CoreFoundation                 0x18170abb8 __CFRunLoopRun + 1628
10 CoreFoundation                 0x181634c50 CFRunLoopRunSpecific + 384
11 GraphicsServices               0x182f1c088 GSEventRunModal + 180
12 UIKit                          0x18691e088 UIApplicationMain + 204
13 Events Near Me                 0x1000880b0 main (AppDelegate.swift:17)
14 libdyld.dylib                  0x1811d28b8 start + 4

any workaround yet?

@wtmoose
Copy link
Member

wtmoose commented Oct 26, 2016

@kwstasna No. I can't get my hands on a jailbroken device. Can you help?

@wtmoose
Copy link
Member

wtmoose commented Oct 26, 2016

@kwstasna Let me clarify that "no". I don't have a workaround I can implement in my library. There is a likely workaround you can implement in your project, as I mentioned in the comment directly above your's.

@kwstasna
Copy link

this was from Fabric Crashlytics. Although i will try to find a jailbroken device to try your possible work around soon.
Thanks :D

@kwstasna
Copy link

One of my users told me that he made my app working by installing Nosu b on his Cydia, which doesnt let cydia substrate to run when the application is open!

Don't know if that helps you!

@wtmoose
Copy link
Member

wtmoose commented Oct 27, 2016

@kwstasna Good to know. Thanks.

@allaire
Copy link
Contributor Author

allaire commented Mar 21, 2017

@wtmoose

You can probably work around the issue by copying the .nib file into your project and removing or changing the image referenced by the image view.

I copied the CardView.xib in my project, but I'm not sure I get the "change the image referenced by the image view" part. Do I have to copy all the xcassets in my project as well?

2017-03-21 at 8 14 am

EDIT: Do you mean to only clear the errorIcon image input field?

@wtmoose
Copy link
Member

wtmoose commented Mar 21, 2017

Do I have to copy all the xcassets in my project as well?

My suggestion is don't use any resources in the framework bundle if you want to avoid crashes on jailbroken devices. The MessageView.configureTheme() method specifically loads images from the framework bundle, so don't use it. Just configure the image view directly using message.imageView?.image = ... and copy any images you want out of the framework into the main bundle.

@allaire
Copy link
Contributor Author

allaire commented Mar 21, 2017

@wtmoose I see! Well, I made a release today with the CardView.xib in my project, but didn't copy any images. we'll see how it goes! Icons were showing up correctly, but I can't test it on a JB device..

@wtmoose
Copy link
Member

wtmoose commented Mar 21, 2017

Aw. Sorry it took me so long to reply

@allaire
Copy link
Contributor Author

allaire commented Mar 21, 2017

@wtmoose No worries, open source does not pay the house :)

You confirm I should be safe with the nib in my project (i cleared the UIImageView image) without the images? From what I see, icons are showing correctly and no crash.

@wtmoose
Copy link
Member

wtmoose commented Mar 22, 2017

I think it will probably crash if you're still calling IconStyle.image(theme : Theme) because this ends up trying to load an image from the framework bundle.

@allaire
Copy link
Contributor Author

allaire commented Mar 22, 2017

@wtmoose Just to confirm, you mean crash on a JB device, correct? Because it doesn't crash on a non JB device, with the xib in my projects and the image loaded from the framework bundle.

Thanks!

@wtmoose
Copy link
Member

wtmoose commented Mar 22, 2017

@allaire I haven't personally witnessed a crash on a non-jailbroken device, so yes.

I'm interested in trying a potential workaround: move images out of asset catalog and switching from pdf to png. If I made that change on a branch, would you be willing to ship that version at some point?

@allaire
Copy link
Contributor Author

allaire commented Mar 22, 2017

@wtmoose I only use pdfs as well. I'll report back if I see any crash with the nib in the project (but without the icons/pdfs). I only have 2-3 crashing users, all JB.

@crossle
Copy link

crossle commented Jul 17, 2017

same problem on Jailbreak device,how to resolve ?

@crossle
Copy link

crossle commented Jul 17, 2017

Could not load the "errorIcon" image referenced from a nib in the bundle with identifier "org.cocoapods.SwiftMessages"

@wtmoose
Copy link
Member

wtmoose commented Jul 17, 2017

@crossle workarounds are discussed in this ticket. To summarize, if you're concerned about jailbroken phones, don't use any resources in the SwiftMessages framework. Copy anything you want to use into your project.

@wtmoose
Copy link
Member

wtmoose commented Jul 17, 2017

I came across this tickets on the CocoaPods library, which seems potentially relevant:

CocoaPods/CocoaPods#6851

@victor-sarda
Copy link

Hey I got the same issue after updating Google Maps Pod from version 2.2.0 to version 2.5.0.
I finally changed Google Maps Pod version back to 2.2.0 and everything went back to normal.
I guess there was a conflict somewhere with this Theme enum but I didn't have time to focus on that, sorry. I saw this PR #35 and I think this could fix your issues.
Hope this will help 🙌

@victor-sarda
Copy link

Here's the crash report: http://crashes.to/s/b56939d1ae3.
The crash message was also Could not load the "errorIcon" image referenced from a nib in the bundle with identifier "org.cocoapods.SwiftMessages"

@wtmoose
Copy link
Member

wtmoose commented Nov 3, 2017

@victor-sarda I can't see how a Theme enum namespace clash would have anything to do with this since the code wouldn't compile.

See the active discussion in #128 as we've identified a fix.

@victor-sarda
Copy link

Oh, cool I didn't see the last comments, good news so!

@Mycose
Copy link

Mycose commented Nov 13, 2017

Just got the same crash recently for a user on my app.
I did the workaround to avoid the crash and have the image.

But there is a quickfix to avoid the crash. Just remove the force unwrap

public var image: UIImage? {
        return UIImage(named: rawValue, in: Bundle.sm_frameworkBundle(), compatibleWith: nil)
    }

It's better to have no icon than a crash for jailbroken users

@wtmoose
Copy link
Member

wtmoose commented Nov 13, 2017

@Mycose it is fixed on the head of the develop branch. Always get the icon. No crash.

@Mycose
Copy link

Mycose commented Nov 13, 2017

@wtmoose oh okay cool !

@allaire
Copy link
Contributor Author

allaire commented Nov 14, 2017

@wtmoose Should I close this then? I'll try to cut a release with the master branch and see how it goes 😄

@wtmoose
Copy link
Member

wtmoose commented Nov 14, 2017

@allaire No. I'll close it when I release 4.0.1, which should be in the next few days.

@wtmoose
Copy link
Member

wtmoose commented Nov 20, 2017

Should be fixed in 4.1.0 (though I can't verify). Reopen if you continue to see an issue.

@wtmoose wtmoose closed this as completed Nov 20, 2017
@annjawn
Copy link

annjawn commented Mar 28, 2018

I am still designing all my alerts using SwiftMessages, and almost all my alerts are custom xib files (made from CardView.xib), is this issue isolated to the default theme based alerts only? Just want to confirm? Or has this been resolved?

@wtmoose
Copy link
Member

wtmoose commented Mar 28, 2018

@annjawn It's fixed.

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

No branches or pull requests

8 participants