Giter VIP home page Giter VIP logo

Comments (59)

crossle avatar crossle commented on May 22, 2024 1
Could not load the "errorIcon" image referenced from a nib in the bundle with identifier "org.cocoapods.SwiftMessages"

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024 1

@annjawn It's fixed.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

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.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.)?

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

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?

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Are you on CocoaPods 1.0.1?

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

Yep!

 $ pod --version
1.0.1

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

Hi @wtmoose,

Thanks for the follow up.

Yes, 100% jailbreak according to Fabric 👍

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

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

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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?

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

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

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

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Do you have a percentage of all users affected?

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

@wtmoose just JB users

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.

from swiftmessages.

kwstasna avatar kwstasna commented on May 22, 2024

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?

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@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.

from swiftmessages.

kwstasna avatar kwstasna commented on May 22, 2024

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

from swiftmessages.

kwstasna avatar kwstasna commented on May 22, 2024

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!

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@kwstasna Good to know. Thanks.

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

Hi,

I have the same problem (on a regular device not a jailbreak one). This issue is random.
Here are the logs in Xcode and I put a screenshot of Xcode too :

capture d ecran 2017-03-01 a 10 54 21
Could not load the "errorIcon" image referenced from a nib in the bundle with identifier "org.cocoapods.SwiftMessages"
fatal error: unexpectedly found nil while unwrapping an Optional value

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@csurbier the only time I've seen this on a non-jailbroken device is when an old version of CocoaPods is used. Make sure you're at least on 1.1.0. If not, upgrade CocoaPods, clean your project, install pods and then see if it works.

Also, what do you mean by "the issue is random"?

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

Thanks for your quick answer.
Here is my version of cocapods used for building the app:
pod --version
1.2.0

This issue is random, meaning the bug happens sometimes and sometimes not (for a same version of the app). I don't know why.
I'm seeing it because I'm receiving crashlytics reports.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@csurbier can you post a screenshot of the Crashlytics device stats?

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

Sure. Here are some screenshots of Crashlytics.

capture d ecran 2017-03-01 a 14 20 56
capture d ecran 2017-03-01 a 15 13 16
capture d ecran 2017-03-01 a 15 13 25
capture d ecran 2017-03-01 a 15 13 53
capture d ecran 2017-03-01 a 15 14 27

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@csurbier Can you click "View all session" and post a screenshot of a specific device stats?

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

like this ?
capture d ecran 2017-03-01 a 15 23 07

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Yep, thanks. Not sure how to fix an issue I can't duplicate. But since you're seeing this on non-jailbroken phones, I think it's time to remove image references from the nib files :(

In the meantime, you can copy the nib file into your project and remove the image reference yourself.

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

yep this bug is strange. I can't always reproduce.
Ok so I will copy everything in my project and will modify your code.

Thanks for your help

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

No problem. All you need to do is copy the nib file into your project and remove the image reference. You don't need to touch the SwiftMessages code.

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

yep 👍

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@csurbier My comment

I think it's time to remove image references from the nib files

doesn't make any sense because I was thinking of a different crash related to the image referenced in the nib file. I don't have a fix for your crash and I can't reproduce it. I really need help from someone who is able to reproduce it on their device.

I don't know much about jailbreaking, but I'm wondering if the version of Crashlytics you're using isn't correctly reporting jailbroken 10.2.1, which is relatively recent.

from swiftmessages.

csurbier avatar csurbier commented on May 22, 2024

Hi,

I have seen this bug multiple time on my personal iPhone which isn't jailbreaked. I'm not able to reproduce since it happens randomly... Anyway I have included the source code/images in my project and it seems to solve the problem.
Thanks anyway

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

@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?

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

@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..

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Aw. Sorry it took me so long to reply

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

@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.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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.

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

@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!

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@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?

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

@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.

from swiftmessages.

crossle avatar crossle commented on May 22, 2024

same problem on Jailbreak device,how to resolve ?

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@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.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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

CocoaPods/CocoaPods#6851

from swiftmessages.

victor-sarda avatar victor-sarda commented on May 22, 2024

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 🙌

from swiftmessages.

victor-sarda avatar victor-sarda commented on May 22, 2024

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"

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

@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.

from swiftmessages.

victor-sarda avatar victor-sarda commented on May 22, 2024

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

from swiftmessages.

Mycose avatar Mycose commented on May 22, 2024

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

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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

from swiftmessages.

Mycose avatar Mycose commented on May 22, 2024

@wtmoose oh okay cool !

from swiftmessages.

allaire avatar allaire commented on May 22, 2024

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

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

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

from swiftmessages.

annjawn avatar annjawn commented on May 22, 2024

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?

from swiftmessages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.