1

I want to use MapBox Search SDK for iOS. So I've followed this official documentation

Firstly, I've created ".netrc" in my /home directory as instruction and then add this -

use_frameworks!
target "TargetNameForYourApp" do
  pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end

to podfile. Then run pod install and got this in terminal -

Analyzing dependencies
Downloading dependencies
Installing MapboxCommon (9.0.2)
Installing MapboxMobileEvents (0.10.8)
Installing MapboxSearch (1.0.0-beta.4)
Installing MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `MapBox.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.

[!] Automatically assigning platform `ios` with version `12.1` on target `MapBox` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

But after running all this I'm getting this error in Xcode -

Framework not found MapboxCommon.xcframework

I've also tried this -

pod deintegrate && pod cache clean --all

pod install

but still the same error.

I think I've followed correctly the documentation and entered the secret API Key correctly. So why am I getting this error?

Edit:

In Project Targets the installed pods are not listed -

Targets In Xcode

But In pod folder in Project directory -

Pods in Project Directory

there are other frameworks available which are not available in Xcode Pods Target.

Is that the pointing that the frameworks are not available in the projects?

Edit:

  • I've checked in my project directory if the Mapbox.common.xcfreamework present or not. And I found that file under pod/mapboxCommon folder
  • I've been opening my project using MapBox.xcworkspace which file was generated after running pod install.
mefahimrahman
  • 197
  • 2
  • 6
  • 29

1 Answers1

1

You are facing this error because you are still trying to build the project file (xcodeproj), not the generated workspace by CocoaPods.

To resolve this issue, open up 'MapBox.xcworkspace' file and use that file to access your projects from now on.

Burak Akkaş
  • 486
  • 3
  • 8
  • no. I've been opening my project using MapBox.xcworkspace file after running pod install – mefahimrahman Apr 11 '21 at 10:47
  • Can you check and share your projects 'Framework Search Paths'? and also can you see 'MapboxCommon' target in Pods project? – Burak Akkaş Apr 11 '21 at 11:53
  • I've checked the framework path. It is in correct path. but how can I check 'MapboxCommon' target in Pods project? – mefahimrahman Apr 11 '21 at 11:54
  • Open the workspace, select 'Pods' project, then you will see 'Targets' of the project. Check here: https://pasteboard.co/JWPtU9o.png from there, go to Build Settings and check 'Framework Search Paths' again. – Burak Akkaş Apr 11 '21 at 11:59
  • But I'm getting different items - https://pasteboard.co/JWPACQs.png and https://pasteboard.co/JWPBzeT.png – mefahimrahman Apr 11 '21 at 12:16
  • 1
    You can open the left view by tapping red-rectangled area: https://pasteboard.co/JWPCdVU.png – Burak Akkaş Apr 11 '21 at 12:20
  • yes!! thank you.. here this is - https://pasteboard.co/JWPIDUr.png – mefahimrahman Apr 11 '21 at 12:36
  • MapboxCommon is missing in the targets – mefahimrahman Apr 11 '21 at 12:36
  • I think something went wrong while pod install. Can you remove these files (https://pasteboard.co/JWPSRON.png), do 'pod integrate', remove your 'Podfile.lock', 'Podfile' files and recreate the Podfile, do a 'pod install' again. And also, which version are you using for CocoaPods? You can check it by typing 'pod --version' to the terminal. – Burak Akkaş Apr 11 '21 at 13:02
  • pod version is 1.5.2 – mefahimrahman Apr 11 '21 at 13:08
  • Can you update it to the latest version first? https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods – Burak Akkaş Apr 11 '21 at 13:10
  • I've faced issues installing cocoapod.. I've used brew to install and it gives me v1.5.2. Here - https://apple.stackexchange.com/questions/418222/installing-cocoapods-to-macos-catalina/418230#418230 – mefahimrahman Apr 11 '21 at 13:13
  • Maybe you can try using 'brew update' first. – Burak Akkaş Apr 11 '21 at 13:24
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/231002/discussion-between-burak-akkas-and-mefahimrahman). – Burak Akkaş Apr 11 '21 at 13:44