ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.54k stars 5.99k forks source link

dyld: Library not loaded: @rpath/Charts.framework/Charts XCODE 11.3.1 #4280

Closed CypriotUnknown closed 4 years ago

CypriotUnknown commented 4 years ago

What did you do?

ℹ I built my app on my physical iphone and put my computer to sleep. When I got back, without making ABSOLUTELY NO changes I built the app once more (clicked the "play" button on XCODE) and ever since I've been getting the error:

dyld: Library not loaded: @rpath/Charts.framework/Charts Referenced from: /private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Test Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts: code signature invalid for '/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts'

/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts: stat() failed with errno=25
/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts: code signature invalid for '/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts'

/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts: stat() failed with errno=1
/pri(lldb) 

Charts Environment

Xcode version: 11.3.1 Swift version: 5something

SerDan73 commented 4 years ago

I also have this problem. After updated MacOS to 10.15.3, Xcode to 11.3.1 and iPad 13.3.1 I cannot build and run my Objective-C project to my iPad anymore. Weird detail: same project builds and run perfectly on iPhone but not on iPad!!! I did reset to factory the iPad but nothing! I'm using Charts 3.4.0

My specific error is:

dyld: Library not loaded: @rpath/Charts.framework/Charts Referenced from: /private/var/containers/Bundle/Application/8B1B691D-AB29-469A-B92C-0B385D24E3B6/MyTestApp.app/MyTestApp Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/8B1B691D-AB29-469A-B92C-0B385D24E3B6/MyTestApp.app/Frameworks/Charts.framework/Charts: code signature invalid for '/private/var/containers/Bundle/Application/8B1B691D-AB29-469A-B92C-0B385D24E3B6/MyTestApp.app/Frameworks/Charts.framework/Charts' /private/var/containers/Bundle/Application/8B1B691D-AB29-469A-B92C-0B385D24E3B6/MyTestApp.app/Frameworks/Charts.framework/Charts: stat() failed with errno=25

Can anyone please share further details/solution/tips? Thank you!

CypriotUnknown commented 4 years ago

This is the first and only error that I couldn’t fix no matter what I tried. I would really appreciate if someone can help. Thanks.

andrewpluu commented 4 years ago

Same thing is happening to me - worked fine before the iOS 13.3.1 update. Builds and runs fine on simulator. Both my iOS devices that were updated don't work (iPhone 11 and iPad Pro). Charts was installed using pods. Also tried the various things suggested on stack overflow like cleaning build folder, refreshing certificates, etc.

andrewpluu commented 4 years ago

Just to provide a bit more detail that might help, I have an iPhone X on 13.3 that runs without issue with the same code, so I suspect it's an iOS 13.3.1 incompatibility. My Xcode is version 11.3.1.

Orackle21 commented 4 years ago

Same here, worked fine on 13.3, but after upgrading to 13.3.1 Charts crash the whole app

volondemar commented 4 years ago

The same for me, after update to 13.3.1 Charts crash. In previous versions, it works fine.

andrewpluu commented 4 years ago

Doing some further research, this seems to be an issue only for free developer accounts (other dependencies like Alamofire have the same issue). Unfortunately the fixes that were brought up in the Alamofire page haven’t worked for me here.

SerDan73 commented 4 years ago

Doing some further research, this seems to be an issue only for free developer accounts (other dependencies like Alamofire have the same issue). Unfortunately the fixes that were brought up in the Alamofire page haven’t worked for me here.

I have a regular Apple Developer Program subscription (PAID), so it's not a issue for free developers. I'll try a way to downgrade by iPad

Orackle21 commented 4 years ago

As a temporary fix you can remove use_frameworks! from your PodFile, this fixed it for me

Edit: I also ran pod update and pod install after that

andrewpluu commented 4 years ago

removing use_frameworks! and adding use_modular_headers! instead worked for me.

SerDan73 commented 4 years ago

removing use_frameworks! and adding use_modular_headers! instead worked for me.

I replaced use_frameworks! with use_modular_headers! just right now. And now the problem is Xcode can't compile because it doesn't reconize the Charts library anymore. I also did run a "pod update" after the change but nothing.

SerDan73 commented 4 years ago

Downgrade iPad to iPadOS 13.2 is not possible anymore. Apple official repository returns an "Access Denied" error! @danielgindi could you please enjoy the discussion and tell us something about this issue please? THX

CypriotUnknown commented 4 years ago

removing use_frameworks! and adding use_modular_headers! instead worked for me.

I replaced use_frameworks! with use_modular_headers! just right now. And now the problem is Xcode can't compile because it doesn't reconize the Charts library anymore. I also did run a "pod update" after the change but nothing.

This i what happened with me as well !

Orackle21 commented 4 years ago

Downgrade iPad to iPadOS 13.2 is not possible anymore. Apple official repository returns an "Access Denied" error! @danielgindi could you please enjoy the discussion and tell us something about this issue please? THX

It's not really "Charts" issue, because many other pods experience this right now (alamofire for example), seems more likely a cocoa pods problem

SerDan73 commented 4 years ago

Downgrade iPad to iPadOS 13.2 is not possible anymore. Apple official repository returns an "Access Denied" error! @danielgindi could you please enjoy the discussion and tell us something about this issue please? THX

It's not really "Charts" issue, because many other pods experience this right now (alamofire for example), seems more likely a cocoa pods problem

When I updated by iPad (last Friday) I wasn't use CocoaPod. I just linked the Charts library and the error popped up. After read about CocoaPod I wanted to create a brand new project with Charts (via CocoaPods) a same error. So IT'S NOT A POD ISSUE @Orackle21 it's a Charts issue... Anyway, waiting for author's reply... I tagged him, I'm getting a chance to PNChart, I'll let you know.

Orackle21 commented 4 years ago

Downgrade iPad to iPadOS 13.2 is not possible anymore. Apple official repository returns an "Access Denied" error! @danielgindi could you please enjoy the discussion and tell us something about this issue please? THX

It's not really "Charts" issue, because many other pods experience this right now (alamofire for example), seems more likely a cocoa pods problem

When I updated by iPad (last Friday) I wasn't use CocoaPod. I just linked the Charts library and the error popped up. After read about CocoaPod I wanted to create a brand new project with Charts (via CocoaPods) a same error. So IT'S NOT A POD ISSUE @Orackle21 it's a Charts issue... Anyway, waiting for author's reply... I tagged him, I'm getting a chance to PNChart, I'll let you know.

Alright, I see. Seems more like embedded frameworks issue, because other frameworks are affected too, not only charts

StephaniesHusband commented 4 years ago

Anyone know of an update on this? Is there a better thread to follow that's more related to actual issue?

FredOleary commented 4 years ago

I ran into this issue and resolved it by removing the "use_frameworks!" line in the PodFile. (This results in charts statically linking). Thank you "Orackle21" !

liuxuan30 commented 4 years ago
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts: code signature invalid for '/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts'

looks like it's about pod issue as you guys mentioned.

The ChartsDemo works fine, and something wrong with the code signature, which we didn't touch.

SerDan73 commented 4 years ago
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts: code signature invalid for '/private/var/containers/Bundle/Application/4B33D98E-3CC3-4632-8164-49F7465AFD92/Test.app/Frameworks/Charts.framework/Charts'

looks like it's about pod issue as you guys mentioned.

The ChartsDemo works fine, and something wrong with the code signature, which we didn't touch.

NOT WORKING...

andrewpluu commented 4 years ago

looks like it's about pod issue as you guys mentioned.

The ChartsDemo works fine, and something wrong with the code signature, which we didn't touch.

The ChartsDemo actually doesn’t work either, but you are correct it is (largely) an Apple/iOS bug.

A few dependencies (but not all of them) are impacted by this bug, and unfortunately as of now it still exists in iOS 13.4 beta as well.

This thread below goes into things in a bit more detail.

https://github.com/Alamofire/Alamofire/issues/3051

Basically the solutions so far are as follows:

  1. Delete use_frameworks! In your podfile.
  2. If that fails, also add the line use_modular_headers! (I needed to do this because if I didn’t, Realm wouldn’t work).
  3. Sign up for a paid Apple account as this seems to be happening to more to free accounts, making it really hard for people who have paid developer accounts to diagnose the problem.
  4. If you’re unwilling to do so and the other options aren’t working for you, you may be out of luck. Submit a bug report to Apple. Even more popular dependencies like Alamofire have been unable to fix this on their end and with iOS 13.4 beta still not working, it may be a while before this is fixed if Apple isn’t made aware of the problem.
liuxuan30 commented 4 years ago

@andrewpluu

The ChartsDemo actually doesn’t work either, but you are correct it is (largely) an Apple/iOS bug.

ChartsDemo with Xcode11.3.1 + iOS13.3 + real iPhone is just fine on my side. I can run it without any problem. I'm not sure what you mean by 'does not work either'.

andrewpluu commented 4 years ago

@liuxuan30 when I try to compile the charts demo, I got the same dyld error as I do when compiling on my program.

danielgindi commented 4 years ago

In cases like these where Xcode just behaves weirdly, I suggest first cleaning up everything (DerivedData, other junk in ~/Library folders). When it doesn't work - I suggest cleaning even deeper. Meaning - delete Xcode, delete all Xcode residue, iPhoneSimulator residue, and everything associated. Look in ~/Library, ~/Library/Applications, etc.

Then reinstall.

This will take some time to redownload Xcode, but not as much as trying to figure out why it misbehaves.

Orackle21 commented 4 years ago

In cases like these where Xcode just behaves weirdly, I suggest first cleaning up everything (DerivedData, other junk in ~/Library folders). When it doesn't work - I suggest cleaning even deeper. Meaning - delete Xcode, delete all Xcode residue, iPhoneSimulator residue, and everything associated. Look in ~/Library, ~/Library/Applications, etc.

Then reinstall.

This will take some time to redownload Xcode, but not as much as trying to figure out why it misbehaves.

It's not Xcode that behaves weirdly, it's actually physical devices that crash

danielgindi commented 4 years ago

Either way - it starts with Xcode. For some it's the simulators that crash, for some it's physical devices.
The root for all of those problems in most cases is caching of signing information/settings/certificates/profiles, sometimes debugging symbols that were pulled from the device, and everything in between. Deleting everything and starting fresh saved me when going from Xcode 7 to 8 (or something similar, when there were similar issues in the upgrade between versions).

CypriotUnknown commented 4 years ago

Either way - it starts with Xcode. For some it's the simulators that crash, for some it's physical devices. The root for all of those problems in most cases is caching of signing information/settings/certificates/profiles, sometimes debugging symbols that were pulled from the device, and everything in between. Deleting everything and starting fresh saved me when going from Xcode 7 to 8 (or something similar, when there were similar issues in the upgrade between versions).

Thank you Daniel. Apart from deleting and reinstalling XCODE, I have tried everything possible out there. I even manually cleaned a lot of files and folders; still no luck. At a convenient time, I WILL delete and reinstall XCODE as well.

danielgindi commented 4 years ago

Do not forget these: (There are probably others I'm forgetting)

CypriotUnknown commented 4 years ago

Do not forget these: (There are probably others I'm forgetting)

  • ~/Library/Developer (the whole folder)
  • ~/Library/Application Support/Xcode
  • ~/Library/Application Support/iPhone Simulator
  • ~/Library/Mobile Device

Just tried these as well. Still no luck =(. In fact if you manually erase the developer folder, the simulator does not build.

andrewpluu commented 4 years ago

Try using the latest 13.4 beta. It looks like Apple has now fixed the bug on their end just recently.

CypriotUnknown commented 4 years ago

Is this issue solved with the latest XCode ? (11.4.1)

nathanchou4 commented 4 years ago

I recently had this error when my phone was on iOS (13.3.1), but when I updated my phone to iOS 13.5.1, the issue was solved.

CypriotUnknown commented 4 years ago

YES, FINALLY IT WORKS. As nathanchou4 says, with the new ios update the issue is solved !

RomanPodymov commented 6 months ago

I think I had a similar issue, and to resolve it I just removed all dynamic versions of all packages from my project.

sparshgupta-truminds commented 4 months ago

I am facing the same issue, my simulator (14 pro max, 17.0) works completely fine, but when I run on my physical device (13, 17.0.3) it gives the same error. The main point is that it worked fine just a couple of hours ago.