ChartsOrg / Charts

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

dyld[1596]: Library not loaded: /System/Library/Frameworks/Charts.framework/Charts #5152

Closed Reyuof-tasheel closed 4 months ago

Reyuof-tasheel commented 4 months ago

What did you do?

update the pod file after add pod 'DGCharts' and remove charts

What did you expect to happen?

works fine with all ios version iOS 14 ,15 ,16 ,17

What happened instead?

the app terminated for iOS 15 all version (15.5 , 15.6 ,15.4 , 15.8 , and 15.1) case crash in the client devices.

I do not have a physical device with ios 15 , so I run on simulator and this what appear in the console is :

dyld[1596]: Library not loaded: /System/Library/Frameworks/Charts.framework/Charts Referenced from: /Users/xxx/Library/Developer/CoreSimulator/Devices/xxx/data/Containers/Bundle/Application/xxx/xxx.app/xxx Reason: tried: '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx/Build/Products/Debug-iphonesimulator/Charts.framework/Charts' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Charts.framework/Charts' (no such file), '/System/Library/Frameworks/Charts.framework/Charts' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Charts.framework/Charts' (no such file)

also, I have tried to remove pod 'DGCharts' and then pod update, pod install to remove the library still the same issue

DGCharts Environment

DGCharts version/Branch/Commit Number:DGCharts (5.0.0) Xcode version:Version 15.0.1 Swift version: swift 4 Platform(s) running DGCharts: iPhone and iPad **macOS version running Xcode: macOS Sonoma 14.0

liuxuan30 commented 4 months ago

For me it looks like

update the pod file after add pod 'DGCharts' and remove charts

is having dirty cache or outdated compile settings either from your cocoapods or your CI toolchain. Charts has been renamed to DGCharts for a while due to Apple's Charts framework naming conflict. If you still see things like /Library/Frameworks/Charts.framework, it's your build settings needs fix. Normally it should be done by Xcode, but looks like you have additional comple steps.

Just check your build settings and Pod hooks to see if you have dirty cache or hardcoded 'Charts.framework' footprint. Update to DGCharts.framework is the key point.

You can verify your App's binary file framework info like

# otool -L ChartsDemo-iOS 
ChartsDemo-iOS:
    ...
    @rpath/DGCharts.framework/DGCharts (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/swift/libswiftFoundation.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/swift/libswiftUIKit.dylib (compatibility version 1.0.0, current version 1.0.0, weak)
       ...

you should see DGCharts instead of Charts