I'm trying to archive my App so I can publish it but the archive fails with this error:
'guard' body must not fall through, consider using a 'return' or 'throw' to exit the scope
I've changed my code from this:
guard
let nibObjects = Bundle.main.loadNibNamed("NativeAdView", owner: nil, options: nil),
let adView = nibObjects.first as? GADNativeAdView
else {
assert(false, "Could not load nib file for adView")
}
setAdView(adView)
refreshAd()
To this:
guard false else {
guard
let nibObjects = Bundle.main.loadNibNamed("NativeAdView", owner: nil, options: nil),
let adView = nibObjects.first as? GADNativeAdView
else {
assert(false, "Could not load nib file for adView")
}
setAdView(adView)
refreshAd()
return
}
but I still get the same error!
The strange thing is that when I test my App on my device or simulator, I don't get any errors at all!
This error only happens during the archive.