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

Unable to install plugin #39

Closed
samoka opened this issue Jun 15, 2021 · 19 comments
Closed

Unable to install plugin #39

samoka opened this issue Jun 15, 2021 · 19 comments

Comments

@samoka
Copy link

samoka commented Jun 15, 2021

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

@robr2112
Copy link

The SDK used with this plugin was recently updated to the new v4, which is now named "BRLMPrinterKit.framework".

@samoka
Copy link
Author

samoka commented Jun 15, 2021

I do see that in the libs directory, just not sure while "cordova build ios" is looking for that specific SDK. :(

@arcadius
Copy link

Hello @samoka , please make sure you fully uninstall the old version of the plugin ...
and possibly, remove ios and re add ios

@samoka
Copy link
Author

samoka commented Jun 15, 2021

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.

@samoka
Copy link
Author

samoka commented Jun 15, 2021

Or maybe there are some files somewhere that I still need to clean up 🤷🏿‍♂️

@arcadius
Copy link

@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

@samoka
Copy link
Author

samoka commented Jun 15, 2021

@arcadius thanks so much for the offer, I will do a codebase search and come back to you with findings ASAP

@samoka
Copy link
Author

samoka commented Jun 16, 2021

@arcadius might need to take you up on the conf call offer, not making any progress.

arcadius added a commit that referenced this issue Jun 16, 2021
arcadius added a commit that referenced this issue Jun 16, 2021
…to-install-on-ios

Unable to install plugin #39 fix
@samoka
Copy link
Author

samoka commented Jun 16, 2021

@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.

@arcadius
Copy link

Yes, I know .... looking into it

arcadius added a commit that referenced this issue Jun 17, 2021
@arcadius
Copy link

@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
Screenshot 2021-06-17 at 02 35 59

Then you can build with xcode and publish without any issue.
Please have a go

@samoka
Copy link
Author

samoka commented Jun 17, 2021

@arcadius Awesome, will give feedback shortly.

@samoka
Copy link
Author

samoka commented Jun 17, 2021

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?
Screenshot at Jun 17 08-16-48

Screenshot at Jun 17 08-19-02

@arcadius
Copy link

@samoka , that one is a separate issue ...
In "architecture" you need to choose : build for active architecture only=YES

More at
https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios

@samoka
Copy link
Author

samoka commented Jun 17, 2021

@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 :)

@samoka
Copy link
Author

samoka commented Jun 17, 2021

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.

Screenshot at Jun 17 12-36-15

@robr2112
Copy link

@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

@arcadius
Copy link

Closing this as @samoka managed to get it working

@robr2112
Copy link

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

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