Closed samoka closed 1 year ago
The SDK used with this plugin was recently updated to the new v4, which is now named "BRLMPrinterKit.framework".
I do see that in the libs directory, just not sure while "cordova build ios" is looking for that specific SDK. :(
Hello @samoka , please make sure you fully uninstall the old version of the plugin ... and possibly, remove ios and re add ios
Did that multiple times already, even uninstalled the plugin removed all platforms, re installed the plugin and added back the platforms. Android installs with no issue, just iOS that comes up with that error.
Or maybe there are some files somewhere that I still need to clean up 🤷🏿♂️
@samoka , please search your codebase for any reference to BRPtouchPrinterKit
I am happy to have a conf call with you to look at this issue
@arcadius thanks so much for the offer, I will do a codebase search and come back to you with findings ASAP
@arcadius might need to take you up on the conf call offer, not making any progress.
@arcadius I see you posted a fix, thanks for that, but looks like we still have some places where BRPtouchPrinterKit is still being imported, e.g BRWLANPrintOperation.h, so building iOS throws an error.
Yes, I know .... looking into it
@samoka , please
cordova plugin rm cordova-plugin-brother-label-printer --save
cordova plugin add cordova-plugin-brother-label-printer --save
Then build your cordova project. The build will fail on iOS.
1- You then need to open XCode. 2- Click on your project in the target 3- then "General" tab and under General tab ... scroll under "Frameworks, Libraries, and Embedded content" 4- Change the "embed" column to "Embed & Sign" as shown in screenshot below
Then you can build with xcode and publish without any issue. Please have a go
@arcadius Awesome, will give feedback shortly.
Ok just tried and got the below, also when adding plugin it didn't automatically add the framework i had to add the framework manually, not sure if that might have contributed to this issue?
@samoka , that one is a separate issue ... In "architecture" you need to choose : build for active architecture only=YES
@arcadius ok, will create a blank fresh project just to test this out, my current one seems to have gotten itself into a knot. Will let you know once I have tested so we can mark this as resolved :)
Managed to get it to work on a clean project, so we can mark this as resolved. Thanks @arcadius
With regards to the architecture issue after googling around finally got a fix that worked for me.
@samoka , yes, setting "Validate Workspace" is the correct "workaround" solution for the issue you mentioned. Note that you should now be able to change this back to "No" to eliminate the warning, if you wish. Xcode 12.3 just needs to add this setting to the project, which setting to "Yes" causes (but also now generates a warning).
The solution that @arcadius mentioned will solve a different problem: "building for iOS Simulator, but linking in Dylib built for iOS". This will occur on Intel Mac when building for Simulator in Release configuration (i.e. "Build for Active Architecture Only" will be set to yes, causing Xcode to generate a UB for simulator which includes "arm64" for M1 processor). If you build for Simulator on M1 Mac, this will occur in BOTH "Debug" and "Release" configurations. The solution in each case is the same, if you run into it: Modify "Excluded Architectures" to exclude "arm64" when building for "Any iOS Simulator SDK"...in either or both Debug and Release configurations. On M1, Xcode will build for "x86_64" instead of "arm64" when attempting to run on the M1 simulator (which presumably will then run successfully under Rosetta).
IMPORTANT NOTE: When you are ready to upload the app to the AppStore, you will run into another problem, because SDK framework lib that is now "embedded" inside the app IPA will contain both Simulator and Device processor slices in the UB (Universal Binary). It will be necessary to remove simulator processors from this framework LIB, because Apple will not allow anything containing simulator processors to be uploaded to AppStoreConnect.
I recommend adding a RunScript to Build Phases. You may see some examples here: https://stackoverflow.com/questions/30547283/submit-to-app-store-issues-unsupported-architecture-x86
I've had good success adapting Michael Radinov's comment to Varrry's accepted answer.
Ultimately, the best solution to all of these issues will be to convert the SDK framework to an "xcframework". This will likely be coming in a future SDK release. So, keep an eye out for these future SDK releases.
-Rob
Closing this as @samoka managed to get it working
FYI, the iOS SDK is now distributed as an "xcframework" as of SDK v4.5.1.
So, that should resolve many of these build errors and warnings that began with Xcode12.
-Rob
Anyone else having this issue?
Cannot find framework "/plugins/cordova-plugin-brother-label-printer/src/ios/libs/BRPtouchPrinterKit.framework" for plugin cordova-plugin-brother-label-printer in iOS platform