0

Compiling Swift 3.2 project stuck and eats up memory in Xcode 9. I believe there are memory leaks in our project. But I can build and run the same project in Xcode 8.3.3 without problems. Can anyone help me with this problem?

Here are the pods I use:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
use_frameworks!
target 'flyakeed' do

    pod 'lottie-ios', '~> 2.1.3'

    pod 'Alamofire', '~> 4.3'

    pod 'SwiftyJSON', '~> 3.1.4'

    pod 'NHRangeSlider', '~> 0.2'

    pod 'MGSwipeTableCell', '~> 1.5.6'

    pod 'Kingfisher', '~> 3.13.1'

    pod 'JTAppleCalendar', :git => 'https://github.com/patchthecode/JTAppleCalendar.git', :commit => 'd705c7467e43ae2675cfde6521bdf52faaebf2de'

    pod 'Socket.IO-Client-Swift', '~> 10.0.0'

    pod 'OneSignal', '>= 2.5.2', '< 3.0'

    pod 'GoogleAnalytics'

    pod 'FBSDKCoreKit'

end

target 'OneSignalNotificationServiceExtension' do

    pod 'OneSignal', '>= 2.5.2', '< 3.0'

end
rmaddy
  • 314,917
  • 42
  • 532
  • 579
J. Goce
  • 279
  • 3
  • 10
  • 1
    Memory leaks in your project are irrelevant to compiling the project. – rmaddy Jan 16 '18 at 06:04
  • Try to check if there any RunScrpits executing. – badhanganesh Jan 16 '18 at 06:32
  • @BadhanGanesh how can i know? I tried checking in build phase under the targets. I found these: [CP] Check Pods Manifest.lock [CP] Embed Pods Framewroks [CP] Copy Pods Resources which I believe is from Cocoapods – J. Goce Jan 16 '18 at 07:19
  • 1
    Did you check the build log to find out where the build gets stuck? You can get the log by opening the Report Navigator (Cmd+9) and selecting the build from the list. – dr_barto Jan 16 '18 at 10:15
  • @dr_barto I did check the build log in the report navigator and it does not show any error. the memory spike occured in "Compile Source File" phase. and when I expand the transcript it just shows the path to each files. – J. Goce Jan 16 '18 at 10:53
  • Where does it get stuck, is it always the same file? – dr_barto Jan 16 '18 at 10:58
  • @dr_barto yup always the same files. – J. Goce Jan 16 '18 at 11:09
  • I assume you already tried the obvious things (clearing, deleting derived data, restarting), so... the Swift compiler sometimes get hung up if the code is too complex, in my experience that happens mostly with protocol/generic code or with optionals (see e.g. https://stackoverflow.com/questions/38174514/xcode-hangs-on-compiling-swift-source-files). If the file that's causing the build to hang (or any other file in the project) contains this kind of complexity, you could try to comment out that code -- this could at least tell you where to start fixing. – dr_barto Jan 16 '18 at 11:19

1 Answers1

0

Doubt this is your issue, but after following @dr_barto's suggestion (Cmd+9), I noticed that I wasn't logged in to any Team... Xcode decided to log me out at some point and kept failing silently.

Eric
  • 3,301
  • 4
  • 33
  • 39