1

I really need some help in a problem which is turning me crazy...

It's about running my app on a device (because the problem doesn't appear on the simulator) and I can't find what how to solve it even reading and trying all the solution along this website.

Once I run the app, it freezes during launching an the next message appear on the debug area:

dyld: Library not loaded: @rpath/GoogleUtilities.framework/GoogleUtilities
  Referenced from: /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/SmiliPRO
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities: code signature invalid for '/private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities'

    /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities: stat() failed with errno=25
    /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities: code signature invalid for '/private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities'

    /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities: stat() failed with errno=1
    /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities: code signature invalid for '/private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities'

    /private/var/containers/Bundle/Application/2C9EB539-D6BA-4291-A62C-4C3A438483CF/SmiliPRO.app/Frameworks/GoogleUtilities.framework/GoogleUtilities: stat() failed with errno=1
(lldb)

Then, on the main screen appears this:

enter image description here

And this:

enter image description here

I'm using Xcode 11.3.1

About how I've added the framework, it was using Cocoapods 1.8.4. Here is my Podfile concerning Google:

target 'SmiliPRO' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  pod 'Google-Mobile-Ads-SDK'

Then, here is how I'm using Google for Ads:

import UIKit
import GoogleMobileAds

class ViewController: UIViewController,
GADBannerViewDelegate {
    @IBOutlet weak var bannerView: GADBannerView!

    override func viewDidLoad() {
        super.viewDidLoad()
        //AdMob del Banner
        bannerView.adUnitID = "ca-app-pub-3940256099942544/2934735716"
        bannerView.delegate = self
        bannerView.rootViewController = self
        bannerView.load(GADRequest())
    }

Concerning the Embedded Binaries, I only have this option where it should be:

enter image description here

If I add here GoogleUtilities.framework, the next error appears during building...

Multiple commands produce '/Users/nachoimac/Library/Developer/Xcode/DerivedData/SmiliPRO-dscwzgjxgxtpzsbkzznkjquojuhz/Build/Products/Debug-iphoneos/SmiliPRO.app/Frameworks/GoogleUtilities.framework':
1) Target 'SmiliPRO' has copy command from '/Users/nachoimac/Library/Developer/Xcode/DerivedData/SmiliPRO-dscwzgjxgxtpzsbkzznkjquojuhz/Build/Products/Debug-iphoneos/GoogleUtilities.framework' to '/Users/nachoimac/Library/Developer/Xcode/DerivedData/SmiliPRO-dscwzgjxgxtpzsbkzznkjquojuhz/Build/Products/Debug-iphoneos/SmiliPRO.app/Frameworks/GoogleUtilities.framework'
2) That command depends on command in Target 'SmiliPRO': script phase “[CP] Embed Pods Frameworks”

I've also tried to comment out use_frameworks into Podfile, a new error appears:

/Users/nachoimac/Library/Developer/Xcode/DerivedData/SmiliPRO-dscwzgjxgxtpzsbkzznkjquojuhz/Build/Products/Debug-iphoneos/Pods_SmiliPRO.framework: No such file or directory

I don't know if the key is that in the original error message appear something like "code signature invalid for", could this be?

Thank you in advance!

Tsilaicos
  • 435
  • 2
  • 13
  • How are you adding the framework to your project? – koen Feb 06 '20 at 20:59
  • Hi koen, I've edited adding some more info. Thank you! – Tsilaicos Feb 08 '20 at 12:57
  • Sorry @koen, you proposal doesn't work exactly for me... I've added again more info about that :( – Tsilaicos Feb 08 '20 at 19:56
  • Did you try commenting out the line use_frameworks in your podfile as discussed in that link? – koen Feb 08 '20 at 20:04
  • Yes but a new error appears... added to the main message. – Tsilaicos Feb 08 '20 at 20:31
  • Maybe this helps: https://stackoverflow.com/questions/49378727/osx-app-crashing-code-signature-invalid - I just find these links by googling the errors you get. You may find other possible solutions as well. – koen Feb 09 '20 at 03:55
  • Nothing... It's so frustrating... Problem looks like coming from iOS 13.3.1 following the next link: https://stackoverflow.com/questions/60015309/running-ios-apps-causes-runtime-error-for-frameworks-code-signature-invalid – Tsilaicos Feb 09 '20 at 13:17
  • Looks like you found the cause. Now wait for Apple to fix this... I suggest you file a radar: https://developer.apple.com/bug-reporting/ – koen Feb 09 '20 at 14:20
  • I'm having this same problem when trying to run on the simulator. On device it works fine. I have experienced this on two different computers. I've tried EVERYTHING - clean project, delete derived data, restart Xcode, restart Mac, unlock/lock keychain, create new developer cert... nothing works. Frustrating doesn't begin to describe it. – Mike Taverne Jun 04 '20 at 20:01

1 Answers1

0

I had this problem when running on the simulator, but not on my device. The problem is that CylanceProtect antivirus software on my MacBook was blocking the GoogleUtilities file:

CylanceProtect quarantine

I contacted my company's security expert and he added a waiver to the policy so that this file is no longer quarantined. Now the app runs fine on the simulator.

You might check if your device is running CylanceProtect or some other antivirus software. It took me 3 days to discover the cause of this problem.

Mike Taverne
  • 9,156
  • 2
  • 42
  • 58