Open BentEngbers opened 2 years ago
Hi @BentEngbers ,
Glad to hear you like another_brother and thank you for the update for the libBROTHERSDK install! I'll take a closer look at the changes once I have some time this weekend and will make the update.
Note: If you are planning on releasing to the Apple Store, you probably want to use the the ios-no-type-b branch instead of the official pub.dev (See here for more info: https://github.com/CodeMinion/another_brother/issues/8#issuecomment-873489374 ) as it turns out the libBROTHERSDK.a does not meet the restrictions.
libBROTHERSDK.a is only used for TypeB printers like RJ-2055WB (https://www.brother-usa.com/products/rj2055wb) so if you don't plan to target those printers and are planning to release to the store you can safely use the branch.
Thanks again for the update and please don't hesitate to reach out if you run into any other issues or have any questions.
Thanks for the info! I will use the ios-no-type-b branch from now on!
Hi @BentEngbers ,
Thanks again for the script update. I gave it a try and it does in fact mark the membership however when I try to build the project it fails with the following error:
ld: library not found for -lBROTHERSDK
Reverting back to the default version and manually selecting the membership allows it to build correctly. Seems it will required a bit more investigation but definitely on the right track.
I'll leave this issue open for now and post any findings.
Thanks again!
Hi @CodeMinion,
Could the ios-no-type-b
branch be updated with the latest changes from main?
I tried to create the PR myself, but i lack the permissions.
Hey @BentEngbers !
Thanks for reaching out about this. I believe the only changes that came in recently are the additional permissions in the manifest. I'll add those in the ios-no-type-b
branch later this weekend.
That said if you would like to make that change and submit a PR before then it will definitely be welcomed!
Thanks again!
Hi @CodeMinion,
Could you update the ios-no-type-b
branch again with the latest changes from main
?
Thanks in advance!
@BentEngbers Hi Bent, I am trying your 'pod install' script for adding the target membership and that works. However i do get the same error as CodeMinion, saying it cannot find the library "ld: library not found for -lBROTHERSDK"
Did you ever solve that issue? I am running the code on a CI/CD server which does a fresh " pod install" each time.
Thanks Peter
I can confirm this issue is happening as well - in my CI/CD server, this is more or less breaking the iOS pipeline.
@CodeMinion is the libBROTHERSDK.a strictly necessary - what about it is indispensable for the package? If I literally only want to use QL1110NWBc, can I strip it out?
Hi @mikhael28 ,
Thanks for the question on this. As mentioned previously in this thread (https://github.com/CodeMinion/another_brother/issues/10#issuecomment-921837394) that library is for support of the Type-B printers.
If you are not looking to use a Type-B printer at all, then the recommended approach is to use the ios-no-type-b branch.
Thanks again,
I will take a look at the ios no type b branch!
@BentEngbers you can refer to this for a workaround of sorts https://github.com/CodeMinion/another_brother/issues/70
Same issue, ios pipeline is broken and no workarounds seem to work for me. Any ideas how to solve this "the right way"?
@koldoon I think the issue is that the Another Brother packages don't support arm64 virtualization - otherwise, you should be able to programatically link them using something like this in the Podfile. Perhaps it's worth taking a look at newer versions of the Brother SDK, to see if that is now supported on iOS?
if target.name == 'another_brother'
puts('Found another brother target')
all_filerefs = installer.pods_project.files
all_filerefs.each do |fileref|
if fileref.path.include? "BROTHERSDK.h"
if (fileref != "libBROTHERSDK.h")
build_phase = target.frameworks_build_phase
unless build_phase.files_references.include?(fileref)
puts("____________________________________")
puts(fileref)
build_phase.add_file_reference(fileref)
end
end
end
if fileref.path.end_with? "libBROTHERSDK.a"
build_phase = target.frameworks_build_phase
unless build_phase.files_references.include?(fileref)
puts("____________________________________")
puts(fileref)
build_phase.add_file_reference(fileref)
end
end
end
end
@CodeMinion any word on updated drivers from Brother potentially fixing this issue?
@mikhael28 Using similar scripts in podfile I indeed get that check set (another_brother membership) but still have build issues: it says that lib BROTHERSDK is not found. If I re-set that check manually in XCode - everything works fine if I build in XCode and if I build using flutter tools. BUT, that option is not being saved in xproject configuration file! i don't know actually where it is being saved, so that when I try to build project in azure CI/CD pipelines I got all same errors.
@koldoon yeah, I think you are getting close. How can we save that option in the xproject configuration file. Maybe if you unblock all the config in the .gitignore, you can see allllll the config changes that are being made? Right now, lots of stuff is being hidden I would imagine by our gitignore options.
Hey guys, I made some tweaks and it works for me now. Maybe you can also try to give some feedback if it works for you too:
puts("Attempting to add libBROTHERSDK.a reference to another_brother.")
installer.pods_project.targets.each do |target|
if target.name == "another_brother"
puts("Found another_brother target.")
all_filerefs = installer.pods_project.files
all_filerefs.each do |fileref|
if fileref.path.end_with? "libBROTHERSDK.a"
puts("Found libBROTHERSDK.a fileref.")
build_phase = target.frameworks_build_phase
puts("Determining if another_brother build phase needs correction.")
unless build_phase.files_references.include?(fileref)
puts("Adding libBROTHERSDK.a to another_brother target")
build_phase.add_file_reference(fileref)
end
end
if fileref.path.end_with? "BROTHERSDK.h"
puts("Found BROTHERSDK.h fileref.")
build_phase = target.headers_build_phase
puts("Determining if another_brother build phase needs correction.")
unless build_phase.files_references.include?(fileref)
puts("Adding BROTHERSDK.h to another_brother target")
build_file = build_phase.add_file_reference(fileref)
end
end
end
puts("Adding paths for the library build")
target.build_configurations.each do |config|
config.build_settings["LIBRARY_SEARCH_PATHS"] = ["$(inherited)", "$(PROJECT_DIR)/BROTHERSDK/BROTHERSDK"]
end
end
end
Yes it works!! I added your script and forced a pod install in Android Studio and rebuild the ios project. Also unchecked the Target Membership in Xcode to be sure the script would do its job! It adds it now automatically!
Great job!
Thanks a lot!
Hey guys, I made some tweaks and it works for me now. Maybe you can also try to give some feedback if it works for you too:
puts("Attempting to add libBROTHERSDK.a reference to another_brother.") installer.pods_project.targets.each do |target| if target.name == "another_brother" puts("Found another_brother target.") all_filerefs = installer.pods_project.files all_filerefs.each do |fileref| if fileref.path.end_with? "libBROTHERSDK.a" puts("Found libBROTHERSDK.a fileref.") build_phase = target.frameworks_build_phase puts("Determining if another_brother build phase needs correction.") unless build_phase.files_references.include?(fileref) puts("Adding libBROTHERSDK.a to another_brother target") build_phase.add_file_reference(fileref) end end if fileref.path.end_with? "BROTHERSDK.h" puts("Found BROTHERSDK.h fileref.") build_phase = target.headers_build_phase puts("Determining if another_brother build phase needs correction.") unless build_phase.files_references.include?(fileref) puts("Adding BROTHERSDK.h to another_brother target") build_file = build_phase.add_file_reference(fileref) end end end puts("Adding paths for the library build") target.build_configurations.each do |config| config.build_settings["LIBRARY_SEARCH_PATHS"] = ["$(inherited)", "$(PROJECT_DIR)/BROTHERSDK/BROTHERSDK"] end end end
I can verify this works for us too. Great job!
@savs90 you are a legend! @CodeMinion you can likely add this to the official documentation, and close some of these issues!
Hi @CodeMinion, Thanks for this awesome flutter library! I had a lot of issues with manually setting the target membership from libBROTHERSDK.a to another_brother. So I added the following script inside the post_install part of the the podFile, to do it automatically! (i modified it from here https://stackoverflow.com/a/61392674/15175952)
The whole post_install now looks like this:
Maybe you could add this to the documentation of this library?