iOS -App Crash on Launch dyld: Library not loaded, Reason: image not found

15,283 views
Skip to first unread message

Amar

unread,
May 12, 2017, 5:03:04 AM5/12/17
to Interactive Media Ads SDK

After updating the IMA SDK to v3.5.2, the app compiles fine but crashes always on all devices with:

dyld: Library not loaded: @rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds

  Referenced from: /var/containers/Bundle/Application/....

  Reason: image not found

Xcode is 8.3.1.

Note

- Added IMA SDK manually to project

Thanks,
Amar

Chris Feldman (IMA SDK Team)

unread,
May 12, 2017, 2:54:47 PM5/12/17
to Interactive Media Ads SDK
Hi Amar,

Have you added the framework to the "Embedded binaries" section in the "General" tab of your app target? For a breakdown of how this is done, you can take a look at this page on StackOverflow.

Regards,
Chris Feldman
IMA SDK Team

Amar

unread,
May 15, 2017, 1:38:44 AM5/15/17
to Interactive Media Ads SDK

Hi Chris,

Yes, i already did the same thing,  it works fine, but during submission got few error mentioned below…
1- iTunes Store operation failed.
Unable to process app at this time due to a general error

2- iTunes Store operation failed.
Unsupported Architectures. The executable for XXX.app/Frameworks/GoogleInteractiveMediaAds.framework contains unsupported architectures '[x86_64, i386]'.

3- iTunes Store operation failed.
Invalid Segment Alignment. The app binary at 'XXXX.app/Frameworks/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version.

iTunes Store operation failed.
The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker.



If i remove IMA SDK from “Embedded binaries” , it upload successfully(but in this case app crash, so i can’t submit app by removing it from “Embedded binaries”). 

-
Amar

Chris Feldman (IMA SDK Team)

unread,
May 15, 2017, 2:34:17 PM5/15/17
to Interactive Media Ads SDK
Hi Amar,

This error is likely happening because the framework contains builds meant for the iOS simulator.  Since you can't upload to the App Store with these architectures included, you'll have to remove them. I'm going to refer you to another StackOverflow thread that has instructions for how to remove the unsupported architectures.

If you continue to have issues, I suggest removing the framework and trying to add it again.

Regards,
Chris Feldman
IMA SDK Team

Amar

unread,
May 19, 2017, 1:16:10 AM5/19/17
to Interactive Media Ads SDK
Hi Chris,
App is now validating..

Thanks,
Amar

Leandro Zanol

unread,
Jul 26, 2017, 5:47:49 PM7/26/17
to Interactive Media Ads SDK
Hi Chris,

I'm having the same problem here.

In my case my project is a SDK (.framework) and I wasn't able to use CocoaPods because I have mixed code (ObjC + Swift) which it didn't seem to support.

This way, I've tried to follow the steps of installing it manually (https://developers.google.com/interactive-media-ads/docs/sdks/ios/quickstart - "Manually, using the SDK download") with your SampleVideoPlayer app, but it didn't work too throwing the following error:

dyld: Library not loaded: @rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds
  Referenced from: /var/containers/Bundle/Application/5CD0AB9D-8C0A-4438-BBC9-3B45BB381480/SampleVideoPlayer.app/SampleVideoPlayer
  Reason: image not found

Any help would be appreciated,
Leandro

Deepika Uragayala (IMA SDK Team)

unread,
Jul 27, 2017, 2:07:26 PM7/27/17
to Interactive Media Ads SDK
Hi Leonardo,

You need to add the IMA Framework as an Embedded Binary as well. This will ensure that the SDK is part of the bundle when built. With CocoaPods, this would have been done automatically.

Regards,
Deepika Uragayala
IMA SDK Team

Leandro Zanol

unread,
Jul 27, 2017, 2:27:36 PM7/27/17
to Interactive Media Ads SDK
Hi Deepika,

Thanks for your prompt reply.

I've tried adding it as an Embedded Binary, but codesign complains "bundle format unrecognized, invalid, or unsuitable". And if I don't sign it, it'll complain at runtime.

Best regards,
Leandro

Deepika Uragayala (IMA SDK Team)

unread,
Jul 27, 2017, 3:37:18 PM7/27/17
to Interactive Media Ads SDK
Hi Leonardo,

Here is a sample app that I have built for you, which manually includes the IMA Framework. Let us know if that resolves the issue.

Regards,
Deepika Uragayala
IMA SDK Team

Manual BasicExample.zip

Leandro Zanol

unread,
Jul 27, 2017, 5:29:15 PM7/27/17
to Interactive Media Ads SDK
Hi Deepika,

Thanks a lot for the working example, through it I was able to figure out what I was doing wrong.

The failure in signing the IMA framework was because I had more than one Framework Search Path registered and though the references in Build Phases were correct, the compiler was prioritizing a different version in one of the registered paths.

Kind regards,
Leandro

Paolo Martin Pascua

unread,
Sep 29, 2017, 2:25:44 PM9/29/17
to Interactive Media Ads SDK
Hi Deepika,

I have the same problem as Leonardo, with my project being a framework project and I'm linking the IMA SDK framework onto our own framework. There is no Embedded Binaries section for our framework project.

We updated the Framework Search Path and the Other Linker Flags through xcconfig files and that works for v3.2.1. But when upgraded to 3.6.0 we encountered this issue.

The sample app you provided doesn't help in my case

Deepika Uragayala (IMA SDK Team)

unread,
Sep 29, 2017, 3:29:39 PM9/29/17
to Interactive Media Ads SDK
Hi Paolo,

Can you provide us a sample app that reproduces this issue? There might be a missed step and I would like to recheck the integration and see what might be the cause. Also, we do have a sample wrapper framework that you can use as well.

Regards,
Deepika Uragayala
IMA SDK Team

Paolo Martin Pascua

unread,
Oct 3, 2017, 12:15:49 PM10/3/17
to Interactive Media Ads SDK
Attached is the modification of your sample wrapper framework that mimics our framework project. Best compiled on the simulator. It makes the "image not found" error and crashes for 3.6.0 but not on 3.2.1 version. 

Paolo Martin Pascua

unread,
Oct 3, 2017, 12:18:01 PM10/3/17
to Interactive Media Ads SDK
Reattaching.
BasicExample&Framework.zip

Shawn Busolits (IMA SDK Team)

unread,
Oct 4, 2017, 11:14:54 AM10/4/17
to Interactive Media Ads SDK
Hey Paolo,

I took a look at your project and I've found a solution. The project is actually missing two Copy Files steps which are required to resolve the issue. First, you'll need to create a new Copy Files phase in your BasicFramework to copy the IMA SDK:


Then set the destination to "Frameworks":


And add the IMA SDK Framework:



You'll then need to repeat these steps in the BasicExample build phases to copy the BasicFramework framework into the app itself:





Note that the second time around we're working in the BasicExample project, not the BasicFramework project, and we're copying BasicFramework.framework instead of GoogleInteractiveMediaAds.framework. Once I take these steps in the workspace you sent me I'm able to build and deploy the app to a simulator. If you have any other questions let me know!


Thanks,

Shawn Busolits

IMA SDK Team

Paolo Martin Pascua

unread,
Oct 4, 2017, 1:11:12 PM10/4/17
to ima...@googlegroups.com
I’m able to get it working now. Thanks

Paolo Martin Pascua



--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/itbcBQIiXQE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.

Paolo Martin Pascua

unread,
Oct 4, 2017, 2:12:58 PM10/4/17
to ima...@googlegroups.com
Sorry, I take it back, the issue wasn’t fixed entirely. It fixed the image not found issue and don’t see the issue on simulator, but when I compiled it on a device, I got a different error, one that required code signature.

The framework we had doesn’t perform code signing upon compiling. It was only when binaries are embedded that it does the code sign.


dyld: Library not loaded: @rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds
  Referenced from: /private/var/containers/Bundle/Application/3F670935-077A-4E6B-BE68-97B64BBB6ECC/VSTBSample_iOS.app/Frameworks/QPAdvertising.framework/QPAdvertising
  Reason: no suitable image found.  Did find:
/private/var/containers/Bundle/Application/3F670935-077A-4E6B-BE68-97B64BBB6ECC/VSTBSample_iOS.app/Frameworks/QPAdvertising.framework/Frameworks/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds: required code signature missing for '/private/var/containers/Bundle/Application/3F670935-077A-4E6B-BE68-97B64BBB6ECC/VSTBSample_iOS.app/Frameworks/QPAdvertising.framework/Frameworks/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds'

Message from debugger: Terminated due to signal 6




Paolo Martin Pascua


Shawn Busolits (IMA SDK Team)

unread,
Oct 5, 2017, 10:31:59 AM10/5/17
to Interactive Media Ads SDK
Hi Paolo,

Are you seeing this with the Basic example you sent me for testing? I'm able to deploy that to a device once I set up my code signing. It sounds like you'll need to set up yours as well. You can take a look at Apple's documentation on that for more info.

Thanks,
Shawn Busolits
IMA SDK Team

Paolo Martin Pascua




Paolo Martin Pascua



To unsubscribe from this group and all its topics, send an email to ima-sdk+unsubscribe@googlegroups.com.

Paolo Martin Pascua

unread,
Oct 5, 2017, 10:59:06 AM10/5/17
to ima...@googlegroups.com
I tested on the Basic example project that I sent, and I got the same error after updating the changes. Are you really sure that it works on your end, cause it obviously not working on my end.

Also, I prefer to have a solution where we don’t have to modify additional settings on the client application project apart from embedding our SDK as binary, as we only deal with supplying just the SDK to our clients


dyld: Library not loaded: @rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds
  Referenced from: /private/var/containers/Bundle/Application/4D13ABAE-9C38-46B7-8FD8-14C928019FF1/BasicExample.app/Frameworks/BasicFramework.framework/BasicFramework
  Reason: no suitable image found.  Did find:
/private/var/containers/Bundle/Application/4D13ABAE-9C38-46B7-8FD8-14C928019FF1/BasicExample.app/Frameworks/BasicFramework.framework/Frameworks/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds: required code signature missing for '/private/var/containers/Bundle/Application/4D13ABAE-9C38-46B7-8FD8-14C928019FF1/BasicExample.app/Frameworks/BasicFramework.framework/Frameworks/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds'


Paolo Martin Pascua



To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.

Leandro Zanol

unread,
Oct 5, 2017, 1:08:32 PM10/5/17
to ima...@googlegroups.com
Hello Paolo,

It seems that the dependency is missing the signature due to the default signing method which is shallow. Try explicitly telling the compiler to deep sign it for you in your app's Build Settings:

Code Signing -> Other Code Signing Flags -> --deep

Hope it works!

Best regards,
Leandro

Paolo Martin Pascua

unread,
Oct 6, 2017, 10:05:59 AM10/6/17
to ima...@googlegroups.com
I have added the flag for code sign, and I got the same error, then I looked at the Xcode log and saw that the flag is added on the codesign command, but only the BasicFramework get its signature updated. Added this flag settings on the app side. 

Really appreciate the help here. 

CodeSign /Users/paolop/Library/Developer/Xcode/DerivedData/BasicExample-awdyybrqkxyjbqeosrncjtmqdrrq/Build/Products/Debug-iphoneos/BasicExample.app/Frameworks/BasicFramework.framework
    cd "/Users/paolop/Downloads/BasicExample&Framework"
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

    

Signing Identity:     "iPhone Developer: Paolo Pascua (2GU8FUSWKW)"

    /usr/bin/codesign --force --sign 9BB1C4B71C8DB76F570F105F81DF056A59126E39 --deep --preserve-metadata=identifier,entitlements,flags --timestamp=none /Users/paolop/Library/Developer/Xcode/DerivedData/BasicExample-awdyybrqkxyjbqeosrncjtmqdrrq/Build/Products/Debug-iphoneos/BasicExample.app/Frameworks/BasicFramework.framework

/Users/paolop/Library/Developer/Xcode/DerivedData/BasicExample-awdyybrqkxyjbqeosrncjtmqdrrq/Build/Products/Debug-iphoneos/BasicExample.app/Frameworks/BasicFramework.framework: replacing existing signature


Paolo Martin Pascua



To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.

Paolo Martin Pascua

unread,
Oct 11, 2017, 12:34:23 PM10/11/17
to ima...@googlegroups.com
Any updates for this?

Paolo Martin Pascua


Shawn Busolits (IMA SDK Team)

unread,
Oct 12, 2017, 1:02:10 PM10/12/17
to Interactive Media Ads SDK
Hey Paolo,

Sorry, I misunderstood your last message - I thought you had resolved your issue. I'm afraid I can't offer much help here - it doesn't look like you're running into any issues with the IMA SDK, but rather an issue signing your custom framework. Are you able to build and sign the sample I sent earlier? If so you can compare that signing workflow there with the one in your app and see if there are any differences?

Thanks,
Shawn Busolits
IMA SDK Team

Paolo Martin Pascua

unread,
Oct 12, 2017, 1:07:41 PM10/12/17
to ima...@googlegroups.com
Hi,

The project that I modified and sent before is based on our project and it follows the same workflow; Build the SDK with the embedded IMA SDK, and then build the app with the recently built embedded SDK . It also follows that both produce the same runtime errors upon installing onto the device. I think its just a matter of the codesign command not able to code sign nested frameworks when building the app, despite adding the —deep flag

Paolo Martin Pascua



To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.

Shawn Busolits (IMA SDK Team)

unread,
Oct 16, 2017, 11:44:06 AM10/16/17
to Interactive Media Ads SDK
Hi Paolo,

This doesn't sound to me like an issue specific to the SDK - have you tried reaching out for help via Apple's support channels?

Thanks,
Shawn Busolits
IMA SDK Team
Reply all
Reply to author
Forward
0 new messages