Charts icon indicating copy to clipboard operation
Charts copied to clipboard

Xcode 14 Issues (ASAP fix needed)

Open MichaelGrigoryan opened this issue 3 years ago • 26 comments

Screen Shot 2022-09-13 at 11 30 47

MichaelGrigoryan avatar Sep 13 '22 07:09 MichaelGrigoryan

Any solution for this? I face the same with this issue, anyway I trying to update to latest version and got another error(current target: 11.0) image

sekny avatar Sep 13 '22 09:09 sekny

I fixed it with the 4.1.0 update (min. deployment target should be iOS 12.)

pod 'Charts', '~> 4.1.0' and pod install --repo-update

for iOS 11 and below: image

the following method should be added where shown in SS

public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element { entries.replaceSubrange(subrange, with: newElements) notifyDataSetChanged() }

huseyinmetin avatar Sep 13 '22 09:09 huseyinmetin

有什么解决办法吗?我面临同样的问题,无论如何我尝试更新到最新版本并得到另一个错误(当前目标:11.0) 图片

Podfile: platform :ios, '12.0'

KeWangKW avatar Sep 13 '22 10:09 KeWangKW

Any solution for this? I face the same with this issue, anyway I trying to update to latest version and got another error(current target: 11.0)

[!] CocoaPods could not find compatible versions for pod "Charts": In Podfile: Charts (~> 4.1.0)

ChartsRealm was resolved to 3.4.0, which depends on
  Charts (~> 3.4.0)

Specs satisfying the Charts (~> 4.1.0), Charts (~> 3.4.0) dependency were found, but they required a higher minimum deployment target.

Lishuo15266176690 avatar Sep 13 '22 11:09 Lishuo15266176690

Screen Shot 2022-09-13 at 3 42 00 PM After i did pod 'Charts', '~> 4.1.0' and pod install --repo-update

building the project would give these errors in Swift Algorithms that is a dependency from Charts.

Can someone help with the issue?

klawsachkar avatar Sep 13 '22 12:09 klawsachkar

Screen Shot 2022-09-13 at 3 42 00 PM

After i did pod 'Charts', '~> 4.1.0' and pod install --repo-update building the project would give these errors in Swift Algorithms that is a dependency from Charts.

Can someone help with the issue?

@klawsachkar were you able to solve this issue? I'm getting same error.

dhruvilpatel07 avatar Sep 13 '22 17:09 dhruvilpatel07

Any solution for this? I face the same with this issue, anyway I trying to update to latest version and got another error(current target: 11.0) image

@sekny unfortunately it seems like ios 12 is the minimum supported version now.

UPDATE: The solution from xgjyjy mentioned below worked for me. Hooray!

EarthHeroOrg avatar Sep 13 '22 19:09 EarthHeroOrg

Also seeing this issue, bumping version to 4.1.0 using SPM did not resolve the issue either.

sethpoly avatar Sep 13 '22 19:09 sethpoly

@sethpoly for dependency rules select branch -> master using SPM. This fixed for me as of now.

dhruvilpatel07 avatar Sep 13 '22 20:09 dhruvilpatel07

ChartsRealm

Cool @EarthHeroOrg, Unfortunately my requirement is set the minimum target 11, is there any other better way?

sekny avatar Sep 14 '22 01:09 sekny

@sethpoly for dependency rules select branch -> master using SPM. This fixed for me as of now.

are you sure, i tried that and it didnt work

klawsachkar avatar Sep 14 '22 07:09 klawsachkar

Charts version: 3.6.0 Xcode version: 14.0 The solution is:

// MARK: RangeReplaceableCollection
extension ChartDataSet: RangeReplaceableCollection {
    
    // add this method
    public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element {
        entries.replaceSubrange(subrange, with: newElements)
        notifyDataSetChanged()
    }
    
    public func append(_ newElement: Element) {
        calcMinMax(entry: newElement)
        entries.append(newElement)
    }

xgjyjy avatar Sep 14 '22 09:09 xgjyjy

Charts version: 3.6.0 Xcode version: 14.0 The solution is:

// MARK: RangeReplaceableCollection
extension ChartDataSet: RangeReplaceableCollection {
    
    // add this method
    public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element {
        entries.replaceSubrange(subrange, with: newElements)
        notifyDataSetChanged()
    }
    
    public func append(_ newElement: Element) {
        calcMinMax(entry: newElement)
        entries.append(newElement)
    }

have you used Pod or SPM for this?

and how did you add the missing conform to protocol method?

klawsachkar avatar Sep 14 '22 10:09 klawsachkar

Screen Shot 2022-09-13 at 3 42 00 PM

After i did pod 'Charts', '~> 4.1.0' and pod install --repo-update building the project would give these errors in Swift Algorithms that is a dependency from Charts.

Can someone help with the issue?

Try adding the following into post_install do |installer| in Podfile if you use Cocoapods so it looks like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        if target.name == "SwiftAlgorithms"
           config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
       end
    end
  end
end

and then run pod install. That might help

idemche avatar Sep 14 '22 11:09 idemche

Any solution for SPM? I must use Charts version: 3.6.0. I can not update latest one. I need a solution for 3.6.0 via SPM.

KoichiroKAMADA avatar Sep 14 '22 12:09 KoichiroKAMADA

Screen Shot 2022-09-13 at 3 42 00 PM After i did pod 'Charts', '~> 4.1.0' and pod install --repo-update building the project would give these errors in Swift Algorithms that is a dependency from Charts. Can someone help with the issue?

Try adding the following into post_install do |installer| in Podfile if you use Cocoapods so it looks like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        if target.name == "SwiftAlgorithms"
           config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
       end
    end
  end
end

and then run pod install. That might help

that solved it for me, thank you a lot

klawsachkar avatar Sep 14 '22 13:09 klawsachkar

@sethpoly for dependency rules select branch -> master using SPM. This fixed for me as of now.

@dhruvilpatel07 Thank you! This solved the issue for now.

sethpoly avatar Sep 14 '22 13:09 sethpoly

Can anyone explain how I can run charts new version?

pod 'Charts', '~> 4.1.0'

pod install --repo-update

When I try I got below error on m1 mac

[!] CocoaPods could not find compatible versions for pod "Charts": In Podfile: Charts (~> 4.1.0)

Specs satisfying the Charts (~> 4.1.0) dependency were found, but they required a higher minimum deployment target.

Rylaa avatar Sep 14 '22 14:09 Rylaa

Can anyone explain how I can run charts new version?

pod 'Charts', '~> 4.1.0'

pod install --repo-update

When I try I got below error on m1 mac

[!] CocoaPods could not find compatible versions for pod "Charts": In Podfile: Charts (~> 4.1.0)

Specs satisfying the Charts (~> 4.1.0) dependency were found, but they required a higher minimum deployment target.

The minimum supported iOS version is 12 with Charts v4, so that might be your issue. See the conversation above for more details. If you are using iOS below 12 see the solution from xgjyjy

EarthHeroOrg avatar Sep 14 '22 17:09 EarthHeroOrg

Try adding the following into post_install do |installer| in Podfile if you use Cocoapods so it looks like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        if target.name == "SwiftAlgorithms"
           config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'
       end
    end
  end
end

and then run pod install. That might help

Thanks @idemche, That also worked for me...

mayesdave avatar Sep 15 '22 01:09 mayesdave

Can anyone explain how I can run charts new version? pod 'Charts', '~> 4.1.0' pod install --repo-update When I try I got below error on m1 mac [!] CocoaPods could not find compatible versions for pod "Charts": In Podfile: Charts (~> 4.1.0) Specs satisfying the Charts (~> 4.1.0) dependency were found, but they required a higher minimum deployment target.

The minimum supported iOS version is 12 with Charts v4, so that might be your issue. See the conversation above for more details. If you are using iOS below 12 see the solution from xgjyjy

I changed the Minimum supported iOS version to 12 but still it's not working

afridikhalid avatar Sep 15 '22 07:09 afridikhalid

Charts version: 3.6.0 Xcode version: 14.0 The solution is:

// MARK: RangeReplaceableCollection
extension ChartDataSet: RangeReplaceableCollection {
    
    // add this method
    public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element {
        entries.replaceSubrange(subrange, with: newElements)
        notifyDataSetChanged()
    }
    
    public func append(_ newElement: Element) {
        calcMinMax(entry: newElement)
        entries.append(newElement)
    }

可以!worked for me!

jobscolin avatar Sep 16 '22 06:09 jobscolin

Can anyone explain how I can run charts new version? pod 'Charts', '~> 4.1.0' pod install --repo-update When I try I got below error on m1 mac [!] CocoaPods could not find compatible versions for pod "Charts": In Podfile: Charts (~> 4.1.0) Specs satisfying the Charts (~> 4.1.0) dependency were found, but they required a higher minimum deployment target.

The minimum supported iOS version is 12 with Charts v4, so that might be your issue. See the conversation above for more details. If you are using iOS below 12 see the solution from xgjyjy

I changed the Minimum supported iOS version to 12 but still it's not working

20220916141025 Have you change the ios Version in podfile?

huangzhengguo avatar Sep 16 '22 06:09 huangzhengguo

Can anyone explain how I can run charts new version? pod 'Charts', '~> 4.1.0' pod install --repo-update When I try I got below error on m1 mac [!] CocoaPods could not find compatible versions for pod "Charts": In Podfile: Charts (~> 4.1.0) Specs satisfying the Charts (~> 4.1.0) dependency were found, but they required a higher minimum deployment target.

The minimum supported iOS version is 12 with Charts v4, so that might be your issue. See the conversation above for more details. If you are using iOS below 12 see the solution from xgjyjy

I changed the Minimum supported iOS version to 12 but still it's not working

20220916141025 Have you change the ios Version in podfile?

I had the same issue, if you're using Mac with M1 then before opening your terminal check the option Open using Rosetta and then open terminal and update your pods again.

Screenshot 2022-09-16 at 9 59 24 AM Screenshot 2022-09-16 at 10 00 05 AM

afridikhalid avatar Sep 16 '22 08:09 afridikhalid

Any solution for SPM? I must use Charts version: 3.6.0. I can not update latest one. I need a solution for 3.6.0 via SPM.

You have to add the repo (zip of 3.6.0) locally like described here: https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package Then you can overwrite the function mentioned earlier in this thread.

mortenkleveland avatar Sep 22 '22 10:09 mortenkleveland

I fixed it with the 4.1.0 update

pod 'Charts', '~> 4.1.0' and pod install --repo-update

Thank you very much for helping me out

huhaopan avatar Sep 27 '22 06:09 huhaopan

Closing since the issue is resolved.

pmairoldi avatar Mar 21 '23 02:03 pmairoldi