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

Mac Catalyst issue with Cocoapods #337

Closed
willm132 opened this issue Jun 9, 2021 · 39 comments
Closed

Mac Catalyst issue with Cocoapods #337

willm132 opened this issue Jun 9, 2021 · 39 comments
Assignees

Comments

@willm132
Copy link

willm132 commented Jun 9, 2021

When compiling for Mac Catalyst I am getting this error:

Undefined symbols for architecture x86_64:
"_format_set_bold",
"_format_set_border",
"_format_set_border_color"
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@jmcnamara
Copy link
Owner

The is just a standard link error. Make such that -lxlsxwriter is on you link command line. She the standard variations here: https://libxlsxwriter.github.io/getting_started.html#gsg_using

@jmcnamara jmcnamara self-assigned this Jun 9, 2021
@willm132
Copy link
Author

willm132 commented Jun 9, 2021

@jmcnamara I am using CocoaPods with Xcode

@jmcnamara
Copy link
Owner

jmcnamara commented Jun 10, 2021

I am using CocoaPods with Xcode

In that case I can't help you much since I don't use CocoaPods myself. Try the following sample code and see if it works: https://github.com/FrankenApps/LibXlsxWriterSwiftSample

Also, are you compiling on a M1 mac?

@jmcnamara jmcnamara changed the title Mac Catalyst Mac Catalyst issue with Cocoapods Jun 10, 2021
@willm132
Copy link
Author

I use Intel iMac and M1 MacBook Pro

@jmcnamara
Copy link
Owner

Do you see the same issue on both systems?

@willm132
Copy link
Author

I have not used the M1 since adding xlsxwriter. I am currently on the iMac.

@jmcnamara
Copy link
Owner

Ok. Can you try the sample app linked above and see if it works.

@willm132
Copy link
Author

Yes, the sample did compile and work on Mac Catalyst. What do I need to do to get my project working?

@jmcnamara
Copy link
Owner

I'd suggest using the sample application and add functionality until it is similar to the app you are trying to compile and use that to figure out why your project isn't working.

Either way I don't think this is a general libxlsxwriter issue, or something that I can help you with, so I am going to close this.

@willm132
Copy link
Author

willm132 commented Jun 10, 2021

@jmcnamara When running via Sample it complies and runs fine, but if I try to build to export via AdHoc I am getting this error:

Umbrella header 'xlsxwriter/libxlsxwriter-umbrella.h' not found

@jmcnamara jmcnamara reopened this Jun 10, 2021
@jmcnamara
Copy link
Owner

@FrankenApps could you help with this issue.

@FrankenApps
Copy link
Contributor

I don't have an Apple Developer Account, so there isn't really a way I could reproduce this. I will still try and have a look...

@willm132
Copy link
Author

Like I said it runs fine on the machine but will not archive

@willm132
Copy link
Author

Any updated on this?

@jmcnamara
Copy link
Owner

Hi Will, you may have better luck on a Catalyst or Cocoapod forum, or StackOverflow. There probably aren't too many Catalyst/Cocoapod users on here.

If you find a solution let us know.

@FrankenApps
Copy link
Contributor

@willm132 Have you checked this?

@willm132
Copy link
Author

@FrankenApps yes I actually did try that but no luck still

@FrankenApps
Copy link
Contributor

Does it work when generating a signed .ipa? As stated above there is no real way to reproduce this for me...

@willm132
Copy link
Author

If I run it from Xcode it installs on the device and works fine, when I go to Project > Archive, this is when it gives me the error

@FrankenApps
Copy link
Contributor

FrankenApps commented Jun 14, 2021

Aha, now I understand. But this only happens when archiving for mac. You can archive it just fine for iOS.

@willm132
Copy link
Author

willm132 commented Jun 14, 2021

@FrankenApps Yes, my project supports Mac Catalyst.

@willm132
Copy link
Author

willm132 commented Jun 14, 2021

Compile Swift source files (x86_64)

BuildProductsPath/Release-maccatalyst/libxlsxwriter/xlsxwriter.framework/Modules/module.modulemap:2:19: Umbrella header 'xlsxwriter/libxlsxwriter-umbrella.h' not found

Could not build Objective-C module 'xlsxwriter'

@FrankenApps
Copy link
Contributor

Well, I do know what the Issue is, but I don't know how to fix it.

There should be an alias for the Headers in BuildProductsPath/Release-maccatalyst/libxlsxwriter/xlsxwriter.framework, but it is not there.

Current:
Bildschirmfoto 2021-06-14 um 21 42 45

How it should be (Sourceful does this right):
Bildschirmfoto 2021-06-14 um 21 43 07

@willm132
Copy link
Author

Is this something I can manually add on my end to resolve this?

@FrankenApps
Copy link
Contributor

I don't know. Might have something to do with Header Search Paths, but I don't know how to fix this. It should be possible to add this alias with a build script, because we know, that it should target Pods/libxlsxwriter/include, but I am definitely not an expert and have no idea how to do this. Also I don't know, why it works for debug builds, because as far as I can tell the settings are exactly the same...

@willm132
Copy link
Author

My header search path contains "${PODS_CONFIGURATION_BUILD_DIR}/libxlsxwriter/xlsxwriter.framework/Headers".

Is this an issue with Libxlsxwriter or my project?

@jmcnamara
Copy link
Owner

This issue looks similar to this one: CocoaPods/CocoaPods#10354

Maybe try update to the latest, beta, cocoapod framework to see if it fixes the issue, as suggested there.

@willm132
Copy link
Author

So how would I go about updating to Cocoapods 1.10.2 beta?

@jmcnamara
Copy link
Owner

You can try this:

gem install cocoapods --pre

As suggested here: https://guides.cocoapods.org/using/getting-started.html

@willm132
Copy link
Author

Would this have something to do with it? after running pod update

[!] The Graf Brothers [Debug] target overrides the OTHER_LDFLAGS build setting defined in Pods/Target Support Files/Pods-Graf Brothers/Pods-Graf Brothers.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or
- Remove the build settings from the target.

[!] The Graf Brothers [Release] target overrides the OTHER_LDFLAGS build setting defined in Pods/Target Support Files/Pods-Graf Brothers/Pods-Graf Brothers.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or
- Remove the build settings from the target.

[!] The Graf BrothersUITests [Debug] target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in Pods/Target Support Files/Pods-Graf Brothers-Graf BrothersUITests/Pods-Graf Brothers-Graf BrothersUITests.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or
- Remove the build settings from the target.

[!] The Graf BrothersUITests [Release] target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in Pods/Target Support Files/Pods-Graf Brothers-Graf BrothersUITests/Pods-Graf Brothers-Graf BrothersUITests.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or
- Remove the build settings from the target.

@willm132
Copy link
Author

@FrankenApps

gem install cocoapods --pre

This installed 1.10.1 which is resulting in the same error

@jmcnamara
Copy link
Owner

In that case you will probably need to install the version in the GitHub repo. I haven't done that before but I presume there is some gem command.

@FrankenApps
Copy link
Contributor

FrankenApps commented Jun 14, 2021

I was able to sucessfully archive my demo project for Catalyst with that method on 1.10.1
Its not a pretty solution but it works, and does basically what I mentioned above using a script.

@willm132
Copy link
Author

So just throw that in a script file and run it while I archive my project?

@FrankenApps
Copy link
Contributor

Yes, and adjust the paths to your local setup.

@jmcnamara
Copy link
Owner

There was an update on the Cocoapods #10224 about how to use Unreleased Cocoapod Features.

Here is a summary of how to get a version of pod with the fix for issue 10224 built in:

# This took a couple of goes:
$ bundle update --bundler


$ cd /tmp
$ git clone git@github.com:CocoaPods/CocoaPods.git
$ cd CocoaPods/
$ git checkout 1-10-stable
$ bundle install
$ echo $(pwd)"/bin/pod"

# So now you should have a patched version of pod. For me this was:
$ echo $(pwd)"/bin/pod"
/tmp/CocoaPods/bin/pod

# Then use this version of pod to install libxlsxwriter:
/tmp/CocoaPods/bin/pod install

Could one of you try that to see if it works.

@jmcnamara jmcnamara reopened this Jun 15, 2021
@jmcnamara
Copy link
Owner

@FrankenApps

Try the https version instead:

git clone https://github.com/CocoaPods/CocoaPods.git

@willm132
Copy link
Author

Yes that is what I did to get it working.

I installed the new CocoaPods, created an alias in terminal for it, ran the new pod update, and that worked! Thank you so much for all the help

@jmcnamara
Copy link
Owner

I'm going to close this again since the original reported issue should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants