line-sdk-ios-swift
line-sdk-ios-swift copied to clipboard
Undefined symbol: dispatch thunk of LineSDK.LineSDKAccessToken.value.getter : Swift.String
Hello,
We are developing a Swift framework to be used in Unity.
While working on adding Line Login, we encountered an issue. We successfully added the dependency via CocoaPods, wrote the necessary code, and built the framework without any errors.
However, when adding the framework to the Unity iOS build project and attempting to build, we encountered issues where certain Swift functions could not be found, such as:
Undefined symbol: dispatch thunk of LineSDK.LineSDKAccessToken.value.getter : Swift.String
Undefined symbol: dispatch thunk of LineSDK.LineSDKLoginResult.accessToken.getter : LineSDK.LineSDKAccessToken
Undefined symbol: dispatch thunk of LineSDK.LineSDKLoginManager.application(_:__C.UIApplication, open: Foundation.URL, options: [__C.UIApplicationOpenURLOptionsKey : Any]) -> Swift.Bool
and along with some other errors of the same kind.
Following the guide, we were able to integrate it successfully using Objective-C. But, our goal is to build the framework purely in Swift.
Would you be able to provide any insights or solutions for this issue?
Hey,
For Unity development, I would suggest to try our Unity package? https://github.com/line/line-sdk-unity Unity requires a C layer to access the native side symbols, so if I am correct, it is not possible to "build the framework purely in Swift" from the very beginning...
And if you still want to use this repo (which is intended for iOS only), LINE SDK for Swift is shipping with an ObjC wrapper layer. So if you are using the ObjC wrapper, you need also to link the Swift library as well. Without that, you will have these errors. It would be helpful if you can provide more information, such as how are you adding this package in your Podfile.
Thank you for your quick response.
We are working on managing Unity-dependent libraries within a single iOS framework.
In our Podfile, we have added both LineSDKSwift and LineSDKSwift/ObjC. (~> 5.0)
As mentioned earlier, we successfully integrated it with Objective-C by following the guide. We are using a separate Objective-C++ wrapper to communicate with Unity, structured as: UnityWrapper <-> Our Framework (Swift + Objective-C) <-> Line SDK
However, what we want is to resolve this issue without creating a separate wrapper class that imports <LineSDK/LineSDK-Swift.h>, but instead by calling it directly using "import LineSDK" in Swift class
Please let us know if any additional information is needed. Thank you.
Thank you for providing detailed information about your integration process.
Unfortunately, we're not very familiar with this specific setup. However, if the linking is done correctly, you should be able to directly call LineSDK's Swift components within your framework using "import LineSDK" (so with the assumption that you can call your Swift framework from Unity, then in the framework you use LineSDK..). Please ensure that LineSDK is properly linked to your framework statically. If you are using a dynamic integration, then maybe you need to link it to both and add a copy phase to the final Unity framework target to make it work.
Beyond that, we might not be able to provide much more assistance, as your use case is quite unique. If you have any other questions or need further clarification, please feel free to reach out.
Thank you for your understanding.