SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 742 forks source link

Crashing at SwiftMessages.Config() or SwiftMessags.defaultConfig version 7.0.1 #423

Closed Nathan2017 closed 3 years ago

Nathan2017 commented 3 years ago

Screen Shot 2020-10-13 at 12 50 57 AM

version 5.0.1 working fine but when upgrading to 7.0.1 instantiate SwiftMessages.Config() or SwiftMessages.defaultConfig caused retain cycle. Hope someone can help me thank you.

wtmoose commented 3 years ago

Sounds like you need to clean your derived data. Also, why aren't you upgrading to version 8?

Nathan2017 commented 3 years ago

Sounds like you need to clean your derived data. Also, why aren't you upgrading to version 8?

Already clean the derived data and also upgrading to version 8 , still getting the retain cycle crash

wtmoose commented 3 years ago

Nobody else is having this issue, so I need more to go on. What do you mean by "retain cycle crash"?

Nathan2017 commented 3 years ago

Screen Shot 2020-10-13 at 1 52 12 AM Screen Shot 2020-10-13 at 1 51 57 AM Setting up the config seem to fix the problem but now there is an error on windowviewcontroller

Nathan2017 commented 3 years ago

Screen Shot 2020-10-13 at 2 01 58 AM Its kind of weird that if i comment out the setup just instantiate the SwiftMessages.Config() i will get swift_retain error

wtmoose commented 3 years ago

I've never seen swift_retain and I don't see much online. Are you compiling with some non-default config? Did you check if you get this in the Demo app? If you can help me reproduce the problem, I can take a look. A sample project would be super helpful.

Drusy commented 3 years ago

I've got this issue switch from 7.0 to work/xcode12 for SPM migration. Clean build helped.

wtmoose commented 3 years ago

Try 8.0.3

wtmoose commented 3 years ago

Closing. No reply since my last suggestion.

RaghavaNaidu46 commented 3 years ago
Screen Shot 2021-05-30 at 8 02 12 PM

I've gone through the thread, but no solution was found. I'm using the latest version(9.0.2). Also cleared derived data and did project clean.

FYI: Your demo project with the same line work perfectly.

kindly help me with the same.

You can contact me at "raghava.dokala@gmail.com" for further discussion. I'm ready to help you to find the root cause.

wtmoose commented 3 years ago

@RaghavaNaidu46 this is going to be an issue with your project configuration, not SwiftMessages itself. Now are you installing SwiftMessages, e.g. CocoaPods, Carthage, Swift Package Manager?

RaghavaNaidu46 commented 3 years ago
Screen Shot 2021-05-31 at 8 23 01 AM

Oh okay. Actually, I'm using SwiftMessages(CocoaPods) for three years, but recently I did a pod update. There the issue occurred. And I agree, my project configuration may be an issue for your new changes. If incase please help to get rid out of it.

RaghavaNaidu46 commented 3 years ago

@wtmoose Any update for me...

jhfkf commented 3 years ago

emmm...
change public struct Config to public class Config everthing will be ok

jhfkf commented 3 years ago

so weird! crashing will appear in one project...

wtmoose commented 3 years ago

@RaghavaNaidu46 I suggest looking through the list of EXC_BAD_ACCESS issues that have been filed:

https://github.com/SwiftKickMobile/SwiftMessages/issues?q=is%3Aissue+exc_bad_access

I believe the most common problem is wrong Swift version. If none of this helps, I really have no idea how to help without reproduction steps or a sample project. This might be a good one to post on StackOverflow.

RaghavaNaidu46 commented 3 years ago

As I told above, it works perfectly within a new project. Will try again to reproduce the issue and share the POC here.

RaghavaNaidu46 commented 3 years ago

@RaghavaNaidu46 I suggest looking through the list of EXC_BAD_ACCESS issues that have been filed:

https://github.com/SwiftKickMobile/SwiftMessages/issues?q=is%3Aissue+exc_bad_access

I believe the most common problem is wrong Swift version. If none of this helps, I really have no idea how to help without reproduction steps or a sample project. This might be a good one to post on StackOverflow.

@wtmoose Yes, it's because of an unspecified swift version. Thanks, brother.

wtmoose commented 3 years ago

Nice