Charts: Swift linking error with XCode 12.5 when used with a react native wrapper

Created on 28 Apr 2021  Â·  8Comments  Â·  Source: danielgindi/Charts

What did you do?

Used react-native-charts-wrapper in my React Native app for iOS. Tried to build and run on XCode 12.5. Linker failed with this error:

Undefined symbols for architecture x86_64:
“Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer) -> (Swift.IndexingIterator, Swift.Int)“, referenced from:
generic specialization > of Swift._copyCollectionToContiguousArray(A) -> Swift.ContiguousArray in libCharts.a(ChartUtils.o)

react-native-charts-wrapper is a React Native wrapper library built on top of Charts for iOS. The only extra step that library requires is the creation of a bridging header in XCode and an extra line in the Podfile: https://github.com/wuxudong/react-native-charts-wrapper/blob/master/installation_guide/README.md#ios. Unsure if those instructions are the source of the problem, or if it's coming from Charts.

What did you expect to happen?

I expected the app to link correctly.

What happened instead?

Linker error, see above.

Charts Environment

React-Native 0.63.3 (happens with other versions of RN too)
Xcode 12.5
react-native-charts-wrapper (master)
Underlying pod Charts 3.3.0 (or 3.6.0)
MacOS: 11.2.3

Reported on the wrapper library's issues page here: https://github.com/wuxudong/react-native-charts-wrapper/issues/801

Most helpful comment

After a lot of digging I found a solution: https://github.com/Iterable/react-native-sdk/issues/86#issuecomment-744829518

All 8 comments

Same issue

For now I think it is necessary to downgrade to xcode 12.4 to fix this problem. Because the project was not compiled in 12.5 and I never got past this error 😔

After a lot of digging I found a solution: https://github.com/Iterable/react-native-sdk/issues/86#issuecomment-744829518

After _a lot_ of digging I found a solution: Iterable/react-native-sdk#86 (comment)

This did not work for me.

Sorry to hear that! It solved the problem for me, both on x86_64 (simulator) and arm64 (my iPhone 12)

For those who are running to this issue, what is your temporary solution?

I wrote up a detailed note on how to get past this here: https://github.com/facebook/react-native/issues/31179#issuecomment-829536845.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heumn picture heumn  Â·  3Comments

coop44483 picture coop44483  Â·  3Comments

guanyanlin picture guanyanlin  Â·  3Comments

Bharati555 picture Bharati555  Â·  4Comments

PrashantKT picture PrashantKT  Â·  3Comments