mixpanel / mixpanel-iphone

Official iOS (Objective-C) Tracking Library for Mixpanel Analytics
http://mixpanel.com
Apache License 2.0
1.05k stars 567 forks source link

Import via SPM doesn't display the latest version: blocks the use of SPM integration #1011

Open AnissaBokhamy opened 1 year ago

AnissaBokhamy commented 1 year ago

Integration Method: Swift Package Manager Xcode Version: Xcode 14.2 Library Version: 5.0.2 Platform: iOS Language: Swift and Objective-C Description: While trying to import Mixpanel-iphone via Swift Package Manager, when selecting option "Exact Version", the prompt automatically selects version 3.0.0.

image

It seems that that this is linked to the fact that the field CFBundleVersion included inside the Info.plist file is set to CURRENT_PROJECT_VERSION, which seems to be set to 3.0.0 in the project.pbxproj file.

☑ Please update the CURRENT_PROJECT_VERSION of the project.pbxproj file.


I am reporting this issue because I imported Mixpanel-iPhone SDK via SPM and I had the following prompt

missing required module 'Mixpanel'

This prompt appeared even though I was following the instructions from the documentation: my project couldn't recognize the framework. I tried forking the project, changing the field CURRENT_PROJECT_VERSION = 5.0.2, re-importing it Mixpanel-iPhone in my project via SPM: it worked 🥳

(For now, I switched to using CocoaPods because the SPM import method doesn't seem to work fine on my end)

ialexhales commented 9 months ago

If Swift Package Manager (SPM) isn't displaying the latest version, try the following steps:

  1. Update your Package.swift file with the correct version or version range for the package.
  2. Run swift package update in the terminal to fetch the latest dependencies.
  3. Clean the Xcode build folder with Shift + Command + K.
  4. Delete the DerivedData folder at ~/Library/Developer/Xcode/DerivedData.
  5. Check the package repository to ensure the latest version is available.
  6. Verify Xcode and SPM updates for any bug fixes.
  7. As a workaround, manually edit Package.swift to use the desired version.

If the issue persists, check package-specific documentation or support channels.