RxSwiftCommunity / RxCoreData

RxSwift extensions for Core Data
MIT License
164 stars 68 forks source link

[iOS 12] RXCoreData crash on iOS 12 #37

Closed hoangtuanfithou closed 6 years ago

hoangtuanfithou commented 6 years ago

it run nicely on iOS 11. then check on iOS 12 -> crash. (mostly when fetch data) more information will be updated

screen shot 2018-06-20 at 6 45 38 pm
bobgodwinx commented 6 years ago

I think we should wait for a GM before updating anything. It's still a beta version.

grigorye commented 6 years ago

Just in case, I was able to mitigate it by enforcing Swift optimization (-Osize) for RxCoreData target. If you use CocoaPods, you can get it by appending the following to your Podfile:

post_install do |installer|
  # Enforce optimization for Xcode 10 beta.
  installer.pods_project.targets.each do |target|
    if target.name =~ /^RxCoreData$/
      puts("Enforcing Swift optimization for RxCoreData/Xcode 10 beta")
      target.build_configurations.each do |configuration|
        configuration.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Osize'
      end
    end
  end
end
hoangtuanfithou commented 6 years ago

Confirm that @griforye method works for me. Thanks so much :)). Now I can use Xcode 10 with dark theme. Can you explain more why it work :D

bobgodwinx commented 6 years ago

@grigorye @hoangtuanfithou Let's see what happens later with the code size optimization option. It's pretty new and was introduced in here in Swift 4.1. If necessary we could activate it in the next version.

grigorye commented 6 years ago

@bobgodwinx Just in case, "-Osize" was just quick hack - I just noticed that the crash doesn't happen in Release builds and hence I tried to enable optimization. Probably it doesn't crash with other optimization options. Anyway, I completely agree that this is just a workaround and we should wait for GM. More or less it looks like a bug in (beta of) Swift compiler that hopefully would be fixed in the upcoming betas (beta 2 still crashes).

grigorye commented 6 years ago

I'm not completely sure about that, but it looks like it was fixed in Xcode 10 beta 3.

hoangtuanfithou commented 6 years ago

confirm that Xcode 10 beta 3 fixed it.

Thanks for your help, guys ! @grigorye @bobgodwinx

screen shot 2018-07-11 at 7 54 45 pm