OneSignal-iOS-SDK icon indicating copy to clipboard operation
OneSignal-iOS-SDK copied to clipboard

[Bug]: Crash on startup for Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore

Open peterpaulis opened this issue 2 years ago • 13 comments

What happened?

updated pods, the app crashes during launch on

Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore

tried Clean and

rm Podfile.lock
pod cache clean --all
pod install --repo-update

Steps to reproduce?

1. pod update
2. clean, build and run on real device

What did you expect to happen?

  • that i can run on device

OneSignal iOS SDK version

OneSignalXCFramework 3.12.3

iOS version

15

Specific iOS version

iOS 16.2, XCode Version 14.2 (14C18)

Relevant log output

dyld[78163]: Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore
  Referenced from: <A32B474F-9332-3CED-90EB-2D2361F63724> /private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/DennikN
  Reason: tried: '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/preboot/Cryptexes/OS@rpath/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/System/Library/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache)
Library not loaded: @rpath/OneSignalCore.framework/OneSignalCore
  Referenced from: <A32B474F-9332-3CED-90EB-2D2361F63724> /private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/DennikN
  Reason: tried: '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCore.framework/OneSignalCore' (errno=2), '/private/var/containers/Bundle/Application/251D6108-2592-44AC-8CE9-175B0F1763CF/DennikN.app/Frameworks/OneSignalCo
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

peterpaulis avatar Feb 14 '23 09:02 peterpaulis

my pod

platform :ios, '13.0'
inhibit_all_warnings!

def app_pods
  
  use_frameworks!

  # SDKs
  pod 'OneSignalXCFramework'
....

peterpaulis avatar Feb 14 '23 09:02 peterpaulis

Hello thank you for reaching out. We have seen this error in some of our wrapper SDKs maybe those threads will help.

Make sure you are using Cocoapods 1.11.3 and try the below code after update. We have seen this issue when using versions lower than 1.11.3. Also, make sure you are using ruby 2.7.5+. We believe Cocoapods 1.11.3 has an FFI dependency that requires a higher ruby version than what you may be using.

rm Podfile.lock
pod cache clean --all
pod install --repo-update

emawby avatar Feb 15 '23 21:02 emawby

The same issue when run project from xcode:

image

Out project is based on cordova with onesignal-cordova-plugin 3.3.0 :

+ ionic info

Ionic:

   Ionic CLI                     : 6.20.8 (/Users/jenkins/jenkins_slave/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node16.19.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.5.4
   @angular-devkit/build-angular : 15.1.6
   @angular-devkit/schematics    : 15.1.6
   @angular/cli                  : 15.1.6
   @ionic/angular-toolkit        : 8.0.0

Cordova:

   Cordova CLI       : 11.1.0
   Cordova Platforms : ios 6.2.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 7 other plugins)

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.1

System:

   ios-deploy : 1.11.4
   ios-sim    : 8.0.2
   NodeJS     : v16.19.0 (/Users/jenkins/jenkins_slave/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node16.19.0/bin/node)
   npm        : 8.19.3
   OS         : macOS Monterey
   Xcode      : Xcode 14.2 Build version 14C18

Podfile:

# DO NOT MODIFY -- auto-generated by Apache Cordova
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
use_frameworks!
target 'rda' do
	project 'rda.xcodeproj'
	pod 'OneSignalXCFramework', '3.12.3'
end

Podfile.lock:

PODS:
  - OneSignalXCFramework (3.12.3):
    - OneSignalXCFramework/OneSignalCore (= 3.12.3)
    - OneSignalXCFramework/OneSignalExtension (= 3.12.3)
    - OneSignalXCFramework/OneSignalOutcomes (= 3.12.3)
  - OneSignalXCFramework/OneSignalCore (3.12.3)
  - OneSignalXCFramework/OneSignalExtension (3.12.3):
    - OneSignalXCFramework/OneSignalCore
    - OneSignalXCFramework/OneSignalOutcomes
  - OneSignalXCFramework/OneSignalOutcomes (3.12.3):
    - OneSignalXCFramework/OneSignalCore

DEPENDENCIES:
  - OneSignalXCFramework (= 3.12.3)

SPEC REPOS:
  trunk:
    - OneSignalXCFramework

SPEC CHECKSUMS:
  OneSignalXCFramework: 75844c29607ca95e6176f6f21257b4382c7fdbfb

PODFILE CHECKSUM: 6fa501b03e19ac918fe9af923be039d6e8cfdea3

COCOAPODS: 1.11.3

System:

#system ruby:
>/usr/bin/ruby --version
ruby 2.6.10p210
#user ruby installed with rbenv and selected with rbenv global 3.2.1 command
>ruby --version
ruby 3.2.1 (2023-02-08...)
>pod --version
1.11.3

Steps to reproduce:

>install nodejs 16.9
>npm install -g [email protected] [email protected] [email protected] @ionic/[email protected]
>git clone https://github.com/anatoly-spb/ionic6-hello.git
>cd ionic6-hello
>node install 
>ionic cordova platforms add [email protected]
>cd platforms/ios
>pod repo update
>pod install
>cd ../..
>ionic cordova build ios
open workspace from platforms/ios in xcode and try to run simulator

Any hints are welcome! Thank you!

anatoly-spb avatar Feb 27 '23 11:02 anatoly-spb

I have downgraded to [email protected] with 'OneSignalXCFramework', '3.11.2' and it solved the problem. So the problem is between 3.11.2 and 3.12.3 versions of OneSignalXCFramework.

anatoly-spb avatar Mar 01 '23 09:03 anatoly-spb

Hi @anatoly-spb, Thanks for reporting. I see:

#system ruby:
>/usr/bin/ruby --version
ruby 2.6.10p210
#user ruby installed with rbenv and selected with rbenv global 3.2.1 command
>ruby --version
ruby 3.2.1 (2023-02-08...)

I suspect the ruby version that is is actually used to build may be the system ruby 2.6.10p210. We have seen this crash resolve for most once they use Cocoapods 1.11.3 and ruby 2.7.5+.

Can you confirm, or make sure xcode is indeed using ruby 3.2.1?

nan-li avatar Mar 07 '23 16:03 nan-li

Hi @anatoly-spb, Thanks for reporting. I see:

#system ruby:
>/usr/bin/ruby --version
ruby 2.6.10p210
#user ruby installed with rbenv and selected with rbenv global 3.2.1 command
>ruby --version
ruby 3.2.1 (2023-02-08...)

I suspect the ruby version that is is actually used to build may be the system ruby 2.6.10p210. We have seen this crash resolve for most once they use Cocoapods 1.11.3 and ruby 2.7.5+.

Can you confirm, or make sure xcode is indeed using ruby 3.2.1?

If xcode uses user's profile, so it must be ruby 3.2.1. Could you please point me how to check it?

Another question is how do you explain that downgrade to previous version solve this problem? It seems to me something wrong is between 3.11 and 3.12 versions.

anatoly-spb avatar Mar 07 '23 18:03 anatoly-spb

@anatoly-spb We have not been able to reproduce the issue going between 3.11 -> 3.12 with Ruby 3.2.1, but I noticed that a Cocoapods update was released and it explicitly requires a higher Ruby version. You could try updating Cocoapods.

emawby avatar Mar 23 '23 17:03 emawby

@anatoly-spb @peterpaulis @nan-li @emawby The issue is related. it expect One Signal XC Frameworks in debug-iPhoneSimulator where as it creates one more folder for OneSignalXCFramework and paste all dyld under that folder as a resultant dyld not found in Debug-iPhoneSImulator. so copy paste all the folder in Debug iPhoneSimulator

Attach is the screen shot Screenshot 2023-04-11 at 3 01 14 AM

Copy all the folder under OneSingalXCFramework and paste it Debug-iPhoneSimulator

What I believe it is releated to Cocoapod version or may be not. I Faced the same issue on other project on our Company own framework while one of the other colleague was not facing such issue.

KhurramIqbal87 avatar Apr 10 '23 22:04 KhurramIqbal87

@KhurramIqbal87 Ah good find that is good to know! Have you tested on the 1.12.+ version of Cocoapods? Cocoapods had not released an update for almost a year but finally did and should have better support for the latest Xcode version.

emawby avatar Apr 11 '23 17:04 emawby

SAME ISSUE WITH SPM

ahmedsafadii avatar Apr 12 '23 16:04 ahmedsafadii

@ahmedsafadii Hello do you have an example project with SPM that can reproduce this issue? I have not been able to reproduce this issue using SPM. Which Xcode version are you using?

emawby avatar Apr 12 '23 21:04 emawby

@ahmedsafadii Hello do you have an example project with SPM that can reproduce this issue? I have not been able to reproduce this issue using SPM. Which Xcode version are you using?

Version 14.2 (14C18)

ahmedsafadii avatar Apr 12 '23 21:04 ahmedsafadii

SAME ISSUE WITH SPM

same

KarimSakr avatar Nov 27 '23 10:11 KarimSakr