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

v1.9.2 Not Working Anymore within a CocoaPod #58

Closed
mharlowfod opened this issue Aug 28, 2020 · 9 comments
Closed

v1.9.2 Not Working Anymore within a CocoaPod #58

mharlowfod opened this issue Aug 28, 2020 · 9 comments

Comments

@mharlowfod
Copy link

Background: I was excited to see that pod update worked properly for v1.8.0+ after I updated to Mac OS Catalina and Xcode 11.6 (with a Swift Version high enough to match 5.1+ that Bugfender started to use). I was immediately disappointed to see that usage of Bugfender within my personal CocoaPod classes had stopped working.

I have narrowed the issue to the fact that if I include a single usage of the SDK in CocoaPod classes (ex. BFLog("Hello World")), I get the following build error (not that including BugfenderSDK as a dependency and also doing import BugfenderSDK in the file do not result in failed build):

ld: warning: ignoring file /Users/administrator/Documents/Sources-CC/b2c-ios/Pods/BugfenderSDK/BugfenderSDK.xcframework/ios-armv7_arm64/BugfenderSDK.framework/BugfenderSDK, missing required architecture x86_64 in file /Users/administrator/Documents/Sources-CC/b2c-ios/Pods/BugfenderSDK/BugfenderSDK.xcframework/ios-armv7_arm64/BugfenderSDK.framework/BugfenderSDK (2 slices)
Undefined symbols for architecture x86_64:
"BugfenderSDK.BFLog(_: Swift.String, _: Swift.CVarArg..., tag: Swift.String?, level: __C.BFLogLevel, filename: Swift.String, line: Swift.Int, funcname: Swift.String) -> ()", referenced from:
closure #1 (Alamofire.DataResponse<FitnessOnDemandClients.APIResponseWithPagination<[FitnessOnDemandClients.ClassDetail]>>) -> () in FitnessOnDemandClients.FilteredVideosViewModel.(updateFromRemote in 0044532F4F68C0DD5C3064F7820FE865)(query: Swift.String?, filterTypes: [FitnessOnDemandClients.FilterType]?, offset: Swift.Int, context: FitnessOnDemandClients.APIRequestContext) -> () in FilteredVideosViewModel.o
(maybe you meant: default argument 2 of BugfenderSDK.BFLog(
: Swift.String, : Swift.CVarArg..., tag: Swift.String?, level: __C.BFLogLevel, filename: Swift.String, line: Swift.Int, funcname: Swift.String) -> (), default argument 3 of BugfenderSDK.BFLog(: Swift.String, _: Swift.CVarArg..., tag: Swift.String?, level: __C.BFLogLevel, filename: Swift.String, line: Swift.Int, funcname: Swift.String) -> () )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is my podspec for reference (redacted naming):
Pod::Spec.new do |s|
s.name = 'MyPod'
s.summary = 'Common library for iOS applications'
s.version = '2.3.0'
s.homepage = 'repo.com'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { Me' => 'me@me.com' }
s.source = { :git => 'git.com', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.source_files = 'MyPod/Classes//*.swift'
s.resource_bundles = {
'MyPod' => ['MyPod/Classes/
/*.{storyboard,xib,xcassets,json,imageset,png,strings}']
}
s.dependency 'BugfenderSDK', '1.9.2'
end

This issue did not present itself in SDK versions 1.7.0 and below.

@RubenVot
Copy link
Contributor

Hi @mharlowfod,
thanks for reaching us. That's a weird error. The v 1.9.2 is widely use now, it would be very weird that the x86_64 slice was missing in the framework.
Could you please check what's your version of cocoapods? You can get it with the pod --version command

@mharlowfod
Copy link
Author

I am on v1.9.1 cocoapods right now. Are you able to do a quick sanity check that Bugfender SDK 1.9.2 is working fine when used within a cocopod?

@RubenVot
Copy link
Contributor

Sure thing! I'm opening a ticket in our internal system and will come back to you after we can check it.
My first impression is that it shouldn't be an issue of Bugfender as a pod is a pod. Using it as a first or second level dependency is a cocoapods configuration issue. I can't think at the moment any reason why the framework would fail.
Anyway, happy to take a look :)
Regards

@RubenVot
Copy link
Contributor

RubenVot commented Sep 3, 2020

Hi @mharlowfod we've been able to reproduce this issue.
This appears to be a bug in the regex that cocoapods uses to choose the XCFramework slice.
More info here: CocoaPods/CocoaPods#10026
I created a sample project and I could confirm that the app will compile when running on a device, but it will fail to compile when executing in the simulator because cocoapods will search for the x86 slice inside the arm slice.
I'm closing this issue as it is a cocoapods bug.
In my experience, the cocoapods team is pretty responsive so I guess this might be fixed soon. Meanwhile, please use a device to run your project.

@RubenVot RubenVot closed this as completed Sep 3, 2020
@orestesgaolin
Copy link

I wanted to report that I have the same issue when building with cocoapods 1.9.3 and using Bugfender v1.9.2. I'm using this in Flutter application (with modified plugin) but I guess the reason for that is the same.

ld: warning: ignoring file /Users/.../BugfenderSDK.framework/BugfenderSDK, 
missing required architecture x86_64 in file /Users/.../ios/Pods/BugfenderSDK/BugfenderSDK.xcframework/ios-armv7_arm64/BugfenderSDK.framework/BugfenderSDK (2 slices)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Bugfender", referenced from:
      objc-class-ref in FlutterBugfenderPlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@RubenVot
Copy link
Contributor

Hi @orestesgaolin
Thanks for reporting, are you able to debug using a device meanwhile?

@orestesgaolin
Copy link

Yes, also works on simulator after upgrade of cocoapods to 1.10.0.beta.2

@CarlSarkisS
Copy link

CarlSarkisS commented Sep 17, 2020

I had the issue for a dependency upgrade in a legacy application, while the compilation was working in a new test project.

It worked after running gem update cocoapods --pre (it installed the version 1.10.0.rc.1).

@mharlowfod
Copy link
Author

Seems, to have worked for me too; thanks for the update command @CarlSarkisS !

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

4 participants