Charts icon indicating copy to clipboard operation
Charts copied to clipboard

Not able to compile code on Xcode 14 Beta 3

Open NiksTambat opened this issue 1 year ago • 5 comments

What did you do?

ℹ I have Updated pods after Xcode and macOS update

What did you expect to happen?

ℹ It should compile the code on Xcode 14 Beta 3 and with iOS 16

What happened instead?

ℹ I am facing following errors in library -

  1. Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection'
  2. Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'
  3. Referencing instance method 'makeIterator()' on 'Collection' requires the types 'IndexingIterator<ChartData>' and 'IndexingIterator<RadarChartData>' be equivalent

Charts Environment

Charts version/Branch/Commit Number: 4.0.3 Xcode version: 14.0 Beta 3 Swift version: 5.0 Platform(s) running Charts: - macOS version running Xcode: Ventura 13.0 Beta

NiksTambat avatar Jul 26 '22 09:07 NiksTambat

Facing same issue.

tariqsclubwise avatar Jul 26 '22 11:07 tariqsclubwise

Also hit this issue. I wonder whether this is related to this Swift bug? https://github.com/apple/swift/issues/60085

AndrewBennet avatar Jul 26 '22 21:07 AndrewBennet

It occurs with Beta 4 released today as well... image

billThePill avatar Jul 28 '22 00:07 billThePill

workaround or patch: append it to extension ChartDataSet: RangeReplaceableCollection

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

have older issue after )))))) charts which also can fix, but move from CocoaPods to SPM Package :)

iDevPro avatar Jul 28 '22 17:07 iDevPro

@iDevPro

Thanks for the solution. It Works for me.

But now I am facing another issue :

Referencing instance method 'makeIterator()' on 'Collection' requires the types 'IndexingIterator<ChartData>' and 'IndexingIterator<RadarChartData>' be equivalent

Screenshot 2022-07-29 at 11 19 23 AM

Please help me if anyone has any solution for this

Charts Environment: -

Charts version/Branch/Commit Number: 4.0.3 Xcode version: 14.0 Beta 3 Swift version: 5.0 Platform(s) running Charts: - macOS version running Xcode: Ventura 13.0 Beta

NiksTambat avatar Jul 29 '22 06:07 NiksTambat

Duplicate of #4860 ?

ghost avatar Aug 01 '22 17:08 ghost

Facing the same issue

Nikojoel avatar Aug 20 '22 13:08 Nikojoel

The same issue here.

josipbernat avatar Aug 23 '22 11:08 josipbernat

Casting the data object to ChartData seems to resolve the "makeIterator" compile errors. I haven't confirmed that the code runs correctly.

for case let set as RadarChartDataSetProtocol in radarData as ChartData where set.isVisible

doshirj avatar Aug 23 '22 20:08 doshirj

The solutions to this problem have been merged into the master branch. However, no new version has been released. So you can use it like

pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :branch => 'master' @josipbernat @doshirj @Nikojoel

alperenarc avatar Sep 05 '22 11:09 alperenarc

The solutions to this problem have been merged into the master branch. However, no new version has been released. So you can use it like

pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :branch => 'master' @josipbernat @doshirj @Nikojoel

Great

premkumarmsc avatar Sep 08 '22 10:09 premkumarmsc

September 12, Xcode 14.0 How to fix this? Screenshot 2022-09-12 at 23 49 35

nikitap1298 avatar Sep 12 '22 20:09 nikitap1298

Can we cut a new release now?

cameronehrlich avatar Sep 12 '22 21:09 cameronehrlich

I've fixed this https://github.com/danielgindi/Charts/pull/4861

nikitap1298 avatar Sep 12 '22 21:09 nikitap1298

closed by https://github.com/danielgindi/Charts/releases/tag/v4.1.0

pmairoldi avatar Sep 13 '22 02:09 pmairoldi

workaround or patch: append it to extension ChartDataSet: RangeReplaceableCollection

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

have older issue after )))))) charts which also can fix, but move from CocoaPods to SPM Package :)

thanks so much bro for your help

usama4792 avatar Sep 15 '22 09:09 usama4792

This was fixed in Charts pod 4.1.0

rupalchawla avatar Sep 17 '22 18:09 rupalchawla

This was fixed in Charts pod 4.1.0

how to update Charts pod to 4.1.0. I try "pod update Charts" but not oke, current version is 3.6.0. i try change in podfile.lock but show error "react-native-charts-wrapper (from ../node_modules/react-native-charts-wrapper) was resolved to 0.5.9, which depends on Charts (= 3.6.0)"

phamhieu1412 avatar Sep 20 '22 05:09 phamhieu1412

Check the platform version in your podfile, update it to 15 and then try pod update again platform :ios, '15.0'

This was fixed in Charts pod 4.1.0

how to update Charts pod to 4.1.0. I try "pod update Charts" but not oke, current version is 3.6.0. i try change in podfile.lock but show error "react-native-charts-wrapper (from ../node_modules/react-native-charts-wrapper) was resolved to 0.5.9, which depends on Charts (= 3.6.0)"

rupalchawla avatar Sep 20 '22 06:09 rupalchawla

Check the platform version in your podfile, update it to 15 and then try pod update again platform :ios, '15.0'

This was fixed in Charts pod 4.1.0

how to update Charts pod to 4.1.0. I try "pod update Charts" but not oke, current version is 3.6.0. i try change in podfile.lock but show error "react-native-charts-wrapper (from ../node_modules/react-native-charts-wrapper) was resolved to 0.5.9, which depends on Charts (= 3.6.0)"

tks you, but not ok, then pod update, charts having version is 3.6.0 and error above :(((, another solution??. i usse react native 0.63.2

phamhieu1412 avatar Sep 20 '22 07:09 phamhieu1412

The solution I provided works for iOS native app, I don't know if same applies to react native

rupalchawla avatar Sep 20 '22 07:09 rupalchawla

This was fixed in Charts pod 4.1.0

how to update Charts pod to 4.1.0. I try "pod update Charts" but not oke, current version is 3.6.0. i try change in podfile.lock but show error "react-native-charts-wrapper (from ../node_modules/react-native-charts-wrapper) was resolved to 0.5.9, which depends on Charts (= 3.6.0)"

https://github.com/wuxudong/react-native-charts-wrapper/issues/894

tejasNix avatar Sep 20 '22 19:09 tejasNix

pod 'Charts', '~> 4.1.0'

It fixes my issues but it creates few more for my project, like

  • Cannot find type 'IAxisValueFormatter' in scope
  • Cannot use optional chaining on non-optional value of type 'Description'

Replace IAxisValueFormatter with AxisValueFormatter Removed ? or just follow Xcode suggestion

smnafiz avatar Sep 23 '22 14:09 smnafiz

pod 'Charts', '~> 4.1.0'

It fixes my issues but it creates few more for my project, like

  • Cannot find type 'IAxisValueFormatter' in scope
  • Cannot use optional chaining on non-optional value of type 'Description'

Replace IAxisValueFormatter with AxisValueFormatter Removed ? or just follow Xcode suggestion

I'm having this same issue

julien-tamade avatar Sep 27 '22 23:09 julien-tamade

Well solution available on the following link, Worked for me

https://stackoverflow.com/questions/74010925/charts-not-compile-on-xcode-14

saqlainbhatti avatar Nov 03 '22 11:11 saqlainbhatti

I meet the same issue, update to 4.1.0 create a few more errors.

Haibo-Zhou avatar Dec 15 '22 05:12 Haibo-Zhou