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

Getting Undefined Symbol Errors when archiving iOS build #54

Open
siddhantverma95 opened this issue Oct 11, 2021 · 6 comments
Open

Getting Undefined Symbol Errors when archiving iOS build #54

siddhantverma95 opened this issue Oct 11, 2021 · 6 comments

Comments

@siddhantverma95
Copy link

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ASExternalEvent", referenced from:
      objc-class-ref in ASPluginEventsHandler.o
  "_AS_COMMANDS_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_HTTP_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
      -[ASPluginEventsHandler handleHTTPRequestCall:result:] in ASPluginEventsHandler.o
      -[ASPluginEventsHandler handleHTTPResponseCall:result:] in ASPluginEventsHandler.o
  "_AS_FS_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_OBJC_CLASS_$_AppSpector", referenced from:
      objc-class-ref in AppSpectorPlugin.o
      objc-class-ref in ASPluginEventsHandler.o
     (maybe you meant: _OBJC_CLASS_$_AppSpectorPlugin)
  "_AS_LOG_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
      -[ASPluginEventsHandler handleLogEventCall:result:] in ASPluginEventsHandler.o
  "_AS_SCREENSHOT_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_ENVIRONMENT_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_COREDATA_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_SQLITE_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_NOTIFICATION_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_DEFAULTS_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_ANALYTICS_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_PERFORMANCE_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_AS_LOCATION_MONITOR", referenced from:
      -[AppSpectorPlugin validateAndMapRawMonitorIds:] in AppSpectorPlugin.o
  "_OBJC_CLASS_$_AppSpectorConfig", referenced from:
      objc-class-ref in AppSpectorPlugin.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Podfile.lock

 - appspector (0.0.1):
    - AppSpectorSDK
    - Flutter
  - AppSpectorSDK (1.4.4)

Pubspec.lock

appspector:
    dependency: "direct main"
    description:
      name: appspector
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.7.0"
@deszip
Copy link
Contributor

deszip commented Oct 11, 2021

Hi @siddhantverma95 , thanks for reporting this. Can you please update plugin to the latest version (0.8.1) and check one more time?

@deszip
Copy link
Contributor

deszip commented Oct 17, 2021

Ok, after a bit of investigation situation is following:

  • we dropped armv7 support in our SDK because we no longer support iOS versions below 11
  • for some reason when you create a new project in Xcode it adds armv7 to architectures list and tries to find appropriate slice in all binaries while archiving. And obviously fails to do that for AppSpector SDK.

Solution we can suggest you is to tell Xcode that you don't need armv7. There are a couple of ways to do that.
One I would recommend to use is just set architectures to arm64 in xcode build settings:

Снимок экрана 2021-10-17 в 15 01 39

Other ways are adding armv7 to EXCLUDED_ARCHS either manually or via post install hook in your podfile:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS"] = "armv7"
  end
end

Hope this works for you, feel free to ping us here in case you have more questions.
We'll keep working on this a bit more and update the issue if we'll find a better solution.

@ch-muhammad-adil
Copy link

In my case I am facing this issue. I have tried few solutions already but not working, Also few works in debug for simulators but not works for real devices and also not works for release..

Error (Xcode): Building for iOS Simulator, but linking in dylib built for iOS, file ‘/Users/adil/Development/Mob/cross-platform/ClientsWork/alp/ios/Pods/AppSpectorSDK/AppSpectorSDK.framework/AppSpectorSDK’ for architecture arm64

@ch-muhammad-adil
Copy link

Can we have sort of proper fix inside the plugin? @deszip

@tomas-carv-com
Copy link

I agree, this does not work for simulator!

@nghiashiyi
Copy link

In my case I am facing this issue. I have tried few solutions already but not working, Also few works in debug for simulators but not works for real devices and also not works for release..

Error (Xcode): Building for iOS Simulator, but linking in dylib built for iOS, file ‘/Users/adil/Development/Mob/cross-platform/ClientsWork/alp/ios/Pods/AppSpectorSDK/AppSpectorSDK.framework/AppSpectorSDK’ for architecture arm64

Add

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

to Podfile work to me.

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

5 participants