Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Undefined symbol: _SWIG_csharp_string_size, _SWIG_csharp_string_str, _SWIG_csharp_string_to_c #1139

Closed
gokhancnr opened this issue Nov 5, 2024 · 20 comments
Assignees
Labels
api: core needs-attention Need Googler's attention

Comments

@gokhancnr
Copy link

Description

I've upgraded my Unity(6000.0.25f1) Projects's Firebase SDK to 11.4.0

When I try to Archieve to distribute it it gives me error:

image

When I searched for:

- _SWIG_csharp_string_size
- _SWIG_csharp_string_str
- _SWIG_csharp_string_to_c

they are all used by Firebase products:

image

What I've tried:

  • Downgrade Xcode
  • pod install
  • update cocoapods
  • Add GameKit.framework

Reproducing the issue

No response

Firebase Unity SDK Version

12.4.0

Unity editor version

6000.0.25f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

Analytics, Crashlytics, Messaging, Remote Config

Other Firebase Component(s) in use

No response

Additional SDKs you are using

AdMob

Targeted Platform(s)

Apple Platforms

Unity editor platform

Mac

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

Undefined symbols for architecture arm64:
  "_SWIG_csharp_string_size", referenced from:
      _SWIGStringWithLengthHelper_SWIG_csharp_string_size_m8F346145417F2C9491498D803A31784BD19013D7 in libGameAssembly.a[22](vu34smn0bqak.o)
      _SWIGStringWithLengthHelper_SWIG_c_to_csharp_string_mE1E23481DA0D5785F7A93B2E2198C097C57B3D5C in libGameAssembly.a[22](vu34smn0bqak.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_size_m16FB33E0B820555284400210117E7A8A52B532FA in libGameAssembly.a[23](mz5zwj743dgj.o)
      _SWIGStringWithLengthHelper_SWIG_c_to_csharp_string_m84428208EED10043F30F6C512792615AE2FAC037 in libGameAssembly.a[23](mz5zwj743dgj.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_size_m1948ACEBEE67E05211F90DE17590914433C663CE in libGameAssembly.a[25](q0ur51tkyt20.o)
      _SWIGStringWithLengthHelper_SWIG_c_to_csharp_string_mC21BFB1DCB3E5CD72C79A7899554A8182198C5CF in libGameAssembly.a[25](q0ur51tkyt20.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_size_m424013BA371C1172D562D03620F1633DB2259C20 in libGameAssembly.a[26](xt9xt4swnlqe.o)
      ...
  "_SWIG_csharp_string_str", referenced from:
      _SWIGStringWithLengthHelper_SWIG_csharp_string_str_m2D07EC24FFFF0DDD94E1F45C362A788592713A3A in libGameAssembly.a[22](vu34smn0bqak.o)
      _SWIGStringWithLengthHelper_SWIG_c_to_csharp_string_mE1E23481DA0D5785F7A93B2E2198C097C57B3D5C in libGameAssembly.a[22](vu34smn0bqak.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_str_m83F8D0FCAAA6F3D1AC73C859088E835E8D9184FF in libGameAssembly.a[23](mz5zwj743dgj.o)
      _SWIGStringWithLengthHelper_SWIG_c_to_csharp_string_m84428208EED10043F30F6C512792615AE2FAC037 in libGameAssembly.a[23](mz5zwj743dgj.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_str_m6D6B1401557AB973D33F49254FCCB69A4C94065D in libGameAssembly.a[25](q0ur51tkyt20.o)
      _SWIGStringWithLengthHelper_SWIG_c_to_csharp_string_mC21BFB1DCB3E5CD72C79A7899554A8182198C5CF in libGameAssembly.a[25](q0ur51tkyt20.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_str_mE8CC0F094D3082710D19C93A28A2C3CF8297B371 in libGameAssembly.a[26](xt9xt4swnlqe.o)
      ...
  "_SWIG_csharp_string_to_c", referenced from:
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c0_mFE6E5675C210B8A012509DFC8D1733ED4BFF08B3 in libGameAssembly.a[22](vu34smn0bqak.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c_m8215BCAC3D160AF742FDBFAE9C3721158B1C1847 in libGameAssembly.a[22](vu34smn0bqak.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c0_m4748CBC22A07C4460FCE76182618154259A699AB in libGameAssembly.a[23](mz5zwj743dgj.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c_m987FC6537DCF628964F5623A836D12D2D153A61D in libGameAssembly.a[23](mz5zwj743dgj.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c0_mBFE7B39ECD66FBAC7F413F646B7537DF0736DBB7 in libGameAssembly.a[25](q0ur51tkyt20.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c_m04B714FEF399DC258EA140985995ED2B51EB5550 in libGameAssembly.a[25](q0ur51tkyt20.o)
      _SWIGStringWithLengthHelper_SWIG_csharp_string_to_c0_m0C29778A973671B9CA23102557968D5372D9B948 in libGameAssembly.a[26](xt9xt4swnlqe.o)
      ...
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet
👀 Replace this line with the contents of your Podfile.lock!
@gokhancnr gokhancnr added new New issue. type: bug labels Nov 5, 2024
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@gokhancnr
Copy link
Author

Anybody?

@AnnMic
Copy link

AnnMic commented Nov 7, 2024

We have the same in Unity 2022.3.50f. Downgraded back to Firebase 12.2.1.

@smarty-concrete
Copy link

Also seeing the same issue with an older version of Unity, so it's probably not a Unity version issue. We had to downgrade to 12.1.0 due to some issues with Sign In with Apple occurring in 12.2 that we were hoping would be fixed by 12.4 (but can't check due to this).

@argzdev argzdev self-assigned this Nov 8, 2024
@farazk86
Copy link

Having the same issue with Unity 2022.3.52f1 and firebase 12.4.0

@jesus-mgtc
Copy link

Same issue with Unity 6000.0.25f1 and Firebase 12.4.0

@R1NoB
Copy link

R1NoB commented Nov 11, 2024

Anbody found any solution to this problem? Downgrading Firebase version worked for anyone? If yes, which version is more stable?

@JeongDongKyun
Copy link

You can try version 12.0.0

@argzdev
Copy link

argzdev commented Nov 11, 2024

Hey folks, thanks for bringing this up to our attention. While we investigate this further, could you help me with the steps to reproduce this behavior?

What I did was the following, however I didn't encounter any issues:

  1. Create a new project in Unity
  2. Use Assets > Import Package > Custom Package...
  3. Add version 12.4.0 of Firebase Analytics, Crashlytics, Messaging, RemoteConfig
  4. Build project with iOS platform
  5. Open in Xcode then select Product > Archive

Am I missing anything? Does this issue only happen during archiving or does it also happen when building? I'm also testing with Unity 6000.0.23f1 if that makes any difference.

@argzdev argzdev added the needs-info Need information for the developer label Nov 11, 2024
@R1NoB
Copy link

R1NoB commented Nov 12, 2024

@argzdev I am using Unity 2022.3.26f1 version and I believe others are also using same Unity 2022.3.x version

@ajaybirla-fabzen
Copy link

ajaybirla-fabzen commented Nov 12, 2024

I'm also getting the same errors while building.

Undefined symbol: _SWIG_csharp_string_size
Undefined symbol: _SWIG_csharp_string_str
Undefined symbol: _SWIG_csharp_string_to_c

Unity: 2021.3.17f1
Xcode: 16.1
Firebase SDK: 12.4.0

@gokhancnr
Copy link
Author

Same for Unity(6000.0.26f1) unfortunately.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Nov 12, 2024
@ilterbilguven
Copy link

Having same errors with Unity 6000.0.27f1 and Xcode 16.1.
Currently latest working version is 12.3.0

@a-maurice
Copy link
Collaborator

Hi all,

While we haven't been able to reproduce the error ourselves, using disassembly tools I have spotted some additional symbols that are present in the C# libraries about SWIGStringWithLengthHelper, which seems to be the root cause of the issue. While I try to determine a proper fix for this, unfortunately the best idea I have is to use 12.3.0.

Sorry for the inconvenience.

@hanilozmen
Copy link

same problem with Xcode 16.1. v12.3.0 works with Xcode 16.1

@R1NoB
Copy link

R1NoB commented Nov 13, 2024

@hanilozmen where can we download 12.3.0 SDK? Can you paste the link here?

@argzdev
Copy link

argzdev commented Nov 13, 2024

Hey @R1NoB, you may find the different versions here. You may also find each Firebase product's different versions .unitypackage in the link.

@hanilozmen
Copy link

hanilozmen commented Nov 13, 2024

@hanilozmen where can we download 12.3.0 SDK? Can you paste the link here?

If you click links inside descriptions, it will start downloading specified Firebase version as a single bundle.
https://github.com/firebase/firebase-unity-sdk/releases

@a-maurice
Copy link
Collaborator

Alright, this should be resolved with the latest release https://github.com/firebase/firebase-unity-sdk/releases/tag/v12.4.1

I wasn't able to reproduce this error myself, but I confirmed with disassembly tools that the SWIGStringWithLengthHelper logic has been removed from the libraries, so hopefully it'll all be good to go.

Thanks for bringing this to our attention.

@gokhancnr
Copy link
Author

And thanks for your interest.

As soon as I've seen regarding release I've tried to rebuild again.. and good news it's working.

Thanks again..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core needs-attention Need Googler's attention
Projects
None yet
Development

No branches or pull requests