SwiftMessages icon indicating copy to clipboard operation
SwiftMessages copied to clipboard

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

Open Nathan2017 opened this issue 6 years ago • 19 comments

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.

Nathan2017 avatar Oct 12 '20 16:10 Nathan2017

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

wtmoose avatar Oct 12 '20 17:10 wtmoose

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

Nathan2017 avatar Oct 12 '20 17:10 Nathan2017

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

wtmoose avatar Oct 12 '20 17:10 wtmoose

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 avatar Oct 12 '20 17:10 Nathan2017

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

Nathan2017 avatar Oct 12 '20 18:10 Nathan2017

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.

wtmoose avatar Oct 12 '20 18:10 wtmoose

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

Drusy avatar Oct 21 '20 07:10 Drusy

Try 8.0.3

wtmoose avatar Oct 25 '20 21:10 wtmoose

Closing. No reply since my last suggestion.

wtmoose avatar Dec 16 '20 19:12 wtmoose

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 "[email protected]" for further discussion. I'm ready to help you to find the root cause.

RaghavaNaidu46 avatar May 30 '21 14:05 RaghavaNaidu46

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

wtmoose avatar May 30 '21 18:05 wtmoose

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 avatar May 31 '21 02:05 RaghavaNaidu46

@wtmoose Any update for me...

RaghavaNaidu46 avatar Jun 02 '21 06:06 RaghavaNaidu46

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

jhfkf avatar Jun 07 '21 09:06 jhfkf

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

jhfkf avatar Jun 07 '21 09:06 jhfkf

@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 avatar Jun 07 '21 13:06 wtmoose

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

RaghavaNaidu46 avatar Jun 15 '21 05:06 RaghavaNaidu46

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

RaghavaNaidu46 avatar Jun 16 '21 06:06 RaghavaNaidu46

Nice

wtmoose avatar Jun 16 '21 14:06 wtmoose