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

Not run in simulator #457

Closed
ravipappyogi opened this issue Jul 3, 2023 · 5 comments
Closed

Not run in simulator #457

ravipappyogi opened this issue Jul 3, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ravipappyogi
Copy link

When trying to run the application with Amplitude get the below error
Undefined symbol: OBJC_CLASS$_Amplitude

Expected Behavior

Should be run with the simulator

Current Behavior

Not able to run with the simulator

Possible Solution

The simulator getting fail but in iPhone device run properly.

Steps to Reproduce

  1. Added swift package library
  2. Application run
  3. Fail

Environment

  • SDK Version: Swift Package manager Amplitude version 8.16.4
  • Device: iPhone simulator
  • OS Version: macOS 13.4 (M1), Xcode version 14.2

Please help us to handle this error and make a runnable build on the iOS simulator.

@ravipappyogi ravipappyogi added the bug Something isn't working label Jul 3, 2023
@Mercy811
Copy link
Contributor

Mercy811 commented Jul 3, 2023

Hi @ravipappyogi, it looks like that the linker is unable to find the definition of the Amplitude class in Objective-C. Could you check if you've followed the guides to install the dependency?

@ravipappyogi
Copy link
Author

Hello
I have followed this step to add Amplitude

  1. Navigate to File > Swift Package Manager > Add Package Dependency.
  2. Enter https://github.com/amplitude/Amplitude-iOS into the search bar.
  3. It automatically resolves to the latest version.

Also, not showing any error while I connected the iPhone device and run on that. Only getting a fail while I am trying to run in the simulator.

Undefined symbol: OBJC_CLASS$_Amplitude

Please let us know if anything manually adds any dependency or if any linker flag needs to add to build settings.

@yuhao900914
Copy link
Collaborator

@ravipappyogi
That's all you need to install amplitude. I'm not able to reproduce this in my local. There have several things you can check.

  • Can clean build and rebuild to see if it fixes the issue?

    • Xcode -> Product -> Clean Build Folder and then build again.
  • Please check after you installed Amplitude-iOS SDK, if there are 2 packages has been installed.
    Screen Shot 2023-07-10 at 4 23 42 PM
    Check if the Amplitude Framework has been auto-added into frameworks section.
    Screen Shot 2023-07-10 at 4 24 53 PM
    Check if Amplitude is under Link Binary With Libraries for your selected target.
    Screen Shot 2023-07-10 at 4 33 03 PM

  • Please also try to clone this simple example to see if it can be built successfully.

Thanks.

@yuhao900914
Copy link
Collaborator

Hi @ravipappyogi ,
any progress on this issue?

@ravipappyogi
Copy link
Author

Hello @yuhao900914
Yes solved the simulator run issue with following changes

Build Settings > Build Active Architecture Only > DEBUG = Yes

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants