Git Product home page Git Product logo

Comments (18)

robr2112 avatar robr2112 commented on August 10, 2024

@cpgb85 Did you recently update to Xcode 12.3 or later?

Assuming Yes:
Look for a Build Setting named "Validate Workspace".
Set it to YES. This should change the build from Error to Warning.
You can then set to NO to eliminate the warning, if desired.
You can also set it to "Yes (Error)", but this will result in failure to build (i.e. your current situation).

The primary issue behind this new Xcode error is that the SDK Framework eventually needs to be converted from a "Fat Binary" (both Device and Simulators) for the LIB file inside the framework to an "xcframework", where device and simulator are separated. This will be a future change to the SDK , but it is not available now.

Beware: For AppStoreConnect upload, with the current SDK, it is REQUIRED to remove the Simulator processors from the SDK framework that is embedded inside your app bundle. It seems that these recent changes to Xcode are trying to circumvent this by increasing the pressure on Framework creators to adopt the relatively new xcframework structure. But, in the meantime, you will need to add a RunScript or similar to remove the simulator processors inside frameworks embedded in your app bundle prior to upload.

Best regards,
Rob

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

This is not the issue. It's specifically this plugin that is causing me problems. It's so frustrating. And it happened randomly.

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

Well, this was the only thing I was aware of that could "randomly" cause Xcode to stop building (i.e. build error) due to the print SDK framework (v3.1.10 and higher). And, it started with Xcode 12.3. And, the solution I gave is the way to fix it (at least when building exclusively with Xcode).

If you wish to provide more info about the SPECIFIC error you get at build-time and the things you've tried to resolve it, then perhaps someone can help you.

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

Sorry. Here is the command it tells me failed:

The following build commands failed: Ld /var/root/Library/Developer/Xcode/DerivedData/Visitor-profgibnqwtxutyxbdipfipgixjktjp/Build/Intermediates.noindex/Visitor-Pro.build/Release-iphonesimulator/Visitor-Pro.build/Objects-normal/x86_64/Binary/Visitor-Pro normal x86_64 (1 failure)

xcodebuild: Command failed with exit code 65

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

What version of Xcode do you have?
What version of the SDK framework do you have?

It seems to be complaining about the x86_64 simulator processor slice for some reason. This should be available in the Universal Binary....at least in the latest SDK releases. Can you goto Terminal and run the "file" command on the framework lib and tell me what processors are listed?

I assume your "release" configuration is set to build ALL architectures, and your "debug" configuration will only build the ACTIVE architecture only. Can you switch to Debug configuration and see if this makes a difference? It may not, since most simulators now use x86_64. But try it and let me know.

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

I will give a try to what you said. I don't know if this makes a difference, I don't think it should but I am using Apple's new macbook pro with the m1 chip.

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

Sorry for not giving anymore detail, but why would it be trying to launch a simulator? I don't want to launch a simulator

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

Using this: #15

I added the libc++.1.tpd, libc++.tpd and libc++abi.tbd libraries. Now I receive the same error but instead of x86_64, it says the same issue with arm64.

Here is the error that appears above:

building for ios simulator, but no linking in object file build for ios, file 'visitor-pro/plugins/cordova-plugin-brother-label-printer/BRPtouchPrinterKit.framework/BRPtouchPrinterKit' for architecture arm64

Clang: error: linker command failed with exit code 1

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

1) What version of the SDK framework do you have?
The one included with the code here is REALLY OLD (v3.1.1). It is a "static" framework. And, this may be why you needed to add libc++. The latest SDK frameworks (3.1.12 and 4.0.2) are "dynamic" and typically don't need to add this. But, it is necessary to "embed" the framework if you choose to update that from our SDK download site.

2) Did you recently install an Xcode update on your Mac?

  • If so, this is probably the "random" source of the new problem.
  • What version of Xcode do you have installed now?
  • What version did you have before?

Xcode 12 caused a lot of issues. I've already discussed that both here and in #15.

3) building for ios simulator
It says that in your error. So, how could you NOT be building for simulator?

  • If you want to build for device, then you need to change something in your development tool to switch from Simulator to Device.
  • If you want to build for simulator, then as I suggested before try to change the configuration from Release to Debug, and I think it may make this error go away.

Sorry, I have no idea about Cordova development environment. I am an Xcode developer for native apps. I support the Brother iOS SDK. I am supporting this plugin out of courtesy. But, if you need help with the Cordova build system, I can't really help with that.

4) Your latest error sounds like one of the new Xcode 12 issues where arm64 is now considered both a simulator and a device processor (previously it was only a device processor, but due to the M1 now there is a simulator version too). It causes a problem typically ONLY when you build for Simulator in the Release configuration.

  • If the "build active architecture only" setting is NO (i.e. Release), then Xcode 12 will try to link the "arm64 for simulator" processor which does NOT exist in our SDK. Instead Xcode linker finds "arm64 for device" which DOES exist in the SDK. But Xcode complains because it is the device version and not the simulator version. This error says something like:
    building for ios simulator, but linking in object file built for ios
    NOTE: This error message is similar but not exactly the same as your error message quoted above. So, please confirm the EXACT error message you are getting. Hopefully, Cordova gives the exact same error as Xcode.

  • And, you can either configure Xcode to "ignore" arm64 if building for simulator (as I mentioned in the other issue 15), or you can tell it to "build active architecture only" = YES (i.e. typical Debug configuration), which will build and link for the simulator you have selected. In this case, it should only build your app for a simulator processor slice that the SDK contains (x86_64 or i386).

  • Another possible solution is what I mentioned at the beginning, which is to set Validate Workspace setting to Yes. The error message in this case is also similar to your last error. So, that's another reason I want to see the EXACT error message that Xcode gives.

Anyway, please answer the questions I've asked about SDK and Xcode versions and the exact error message you are getting.

Thanks,
Rob

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

I'm a JavaScript developer and I am fluent in it. I typically use Vue to create web applications. When it comes to xCode, I am pretty much clueless. I have to wonder why apple thought this was a fantastic idea to make it this hard to develop applications for their platform.

  1. I'm using the SDK provided with this plugin because it was working previously. As stated above I would have a hard time trying to upgrade it but I might be able to manage.
  2. I'm using xcode 12.4. Before I convinced my work to buy me a modern macbook, I was working on a mac mini from 2011. I'm not sure which version was on there. But originally my program compiled on the new macbook.
  3. How can I not build for simulator? I just want to compile my app to put it on my device.
  4. M1 is the macbook that i have.

On a side note, what are the chances I could convince you to make a new plugin with me? I could do the JS side and you can do the sdk side. Seeing that this one is pretty much dead.

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

Thanks for the answers. I understand and feel your pain lol.
A few years ago, I dabbled with trying to make a Cordova plugin. So, I'm at least familiar.
I was using Visual Studio on Windows as the main dev tool, though of course for iOS it requires connecting to a Mac with Xcode.
I've since updated to newer PC and Mac, and I can't get the Cordova development environment working (in very brief attempt several months ago). I'm not sure that Microsoft even supports Cordova in Visual Studio anymore.

So, what IDE are you actually using to build?

  • If you're actually building with Xcode directly (rather than using something like Visual Studio), I can certainly help you to configure all the Build Settings, Release vs Debug configuration (in the Scheme), and selecting to build for Simulator vs Device.

  • In Visual Studio on Windows PC, I can see that it's possible to select Device vs Simulator and Release vs Debug for my old project. But, I have no recollection of how to configure Xcode build settings from here.

  • And, if you are using some other IDE tool entirely, then I have no clue about that either.

As for a collaboration on a new Cordova plugin that's up to date with our SDKs and "officially" supported, I'd be open to considering it. However, this is not high on my priority list right now. So, this is not likely to happen soon.

For now, let's try to figure this out, because it sounds more like a build system issue than an issue with this plugin per se.
And, since it was working for you recently, it shouldn't be necessary to update the SDK. I think it's related to these Xcode 12 changes that require changes to the Build Settings to get around errors that are similar (inside Xcode) to what you are reporting. However, most of my understanding of these issues are related to the latest v4 SDK and I haven't tried with this really old 3.1.1 SDK with Xcode 12.

Cheers,
Rob

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

I actually got it! following the tips you gave in step 4, I was able to build and install my app to my development iPad and it works! Thank you for all your help! I think we should still look into either updating this plugin or creating a new one. I would I just don't know how. What sucks is that this is the only brother label printer plugin that there is.

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

Awesome! So, for anyone who may stumble across this in the future with a similar problem:
Which specific suggestion actually resolved this for you?

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

In xcode under build settings > architecture. I changed Build active architecture only from "multiple" to "Yes"

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

OK. It probably said "multiple" before because it was set to YES for Debug and NO for Release.
You could have changed your "scheme" in Xcode to build for Debug instead of Release, and that should have worked too with the previous setting for this.

Beware that by changing this to YES for Release, your RELEASE app on the AppStore will NOT contain all device processors, it will only have the processor for the currently connected device (i.e. your iPad). This will likely be a problem for you later.
So, you should change it back!!

Then, "Edit Scheme" so that "Run" uses the "Debug" build configuration (instead of "release").

There may still be a problem when you eventually build for release (i.e. "Archive").
So, we'll need to figure out how to resolve that still.

The original suggestion I gave (re "Validate Workspace") might resolve this.
So, please review that suggestion and give it a try if you haven't already.

-Rob

from cordova-plugin-brother-label-printer.

cpgb85 avatar cpgb85 commented on August 10, 2024

OK. It probably said "multiple" before because it was set to YES for Debug and NO for Release.
You could have changed your "scheme" in Xcode to build for Debug instead of Release, and that should have worked too with the previous setting for this.

Beware that by changing this to YES for Release, your RELEASE app on the AppStore will NOT contain all device processors, it will only have the processor for the currently connected device (i.e. your iPad). This will likely be a problem for you later.
So, you should change it back!!

Then, "Edit Scheme" so that "Run" uses the "Debug" build configuration (instead of "release").

There may still be a problem when you eventually build for release (i.e. "Archive").
So, we'll need to figure out how to resolve that still.

The original suggestion I gave (re "Validate Workspace") might resolve this.
So, please review that suggestion and give it a try if you haven't already.

-Rob

What would it take for you to help me ready an app for submission to the app store? This xcode thing confuses me.

from cordova-plugin-brother-label-printer.

robr2112 avatar robr2112 commented on August 10, 2024

I'd recommend that you jump into the "official" Brother Support channels.

Here is a link to our Developer Program website. Sign-up is free for the most basic level.
It helps us to have some insight into who we are working with and what you are trying to accomplish.
https://developerprogram.brother-usa.com/

There's also a Contact Us option there where you can send an email.

  • Mention the specific printer model(s) you are trying to support. I suspect you are using a QL printer, so someone on our QL support team may be assigned to assist.

  • Also, mention the link to this discussion and that you've been chatting with me here. They can CC me on their responses so I can jump in as well.

-Rob

from cordova-plugin-brother-label-printer.

arcadius avatar arcadius commented on August 10, 2024

@cpgb85 ,if your issue has been resolved, please feel free to mark this as closed please

from cordova-plugin-brother-label-printer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.