Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Missing Info.plist in MapboxEvents.framework error with CocoaPods 1.10.0 & Xcode 12.2. #555

Open
mkieselmann opened this issue Nov 21, 2020 · 26 comments

Comments

@mkieselmann
Copy link

mkieselmann commented Nov 21, 2020

Missing Info.plist in MapboxEvents.framework error when installing Mapbox iOS SDK with CocoaPods 1.10.0 & Xcode 12.2.

Steps to reproduce

  1. Install Cocoapods 1.10.0
  2. Create new iOS project in Xcode 12.2
  3. pod init
  4. Add Mapbox iOS SDK according to https://docs.mapbox.com/ios/maps/overview/#install-the-maps-sdk
  5. Run app in simulator or device

Expected behavior

App launches properly with Mapbox iOS SDK linked.

Actual behavior

Before the app actually launches Xcode shows the error of a missing Info.plist:
Bildschirmfoto 2020-11-21 um 11 01 54

Removing use frameworks! from the Podfile as suggested here does not work either. Then, Mapbox.framework cannot find the statically linked MapboxEvents.framework and dynamic linking fails at app start.

dyld: Library not loaded: @rpath/MapboxMobileEvents.framework/MapboxMobileEvents
  Referenced from: /Users/p369242/Library/Developer/CoreSimulator/Devices/8B197CE8-08FB-4F2A-B9FB-4D5C5C92CC4A/data/Containers/Bundle/Application/E5AC52D9-4D5B-4355-B84A-E6F4C9B8FD0F/MapboxCocoaPods.app/Frameworks/Mapbox.framework/Mapbox
  Reason: image not found

Configuration

Mapbox SDK versions: 6.3.0, 6.2.2
iOS/macOS versions: 14.2
Device/simulator models: any
Xcode version: 12.2
CocoaPods version: 1.10.0

@mkieselmann
Copy link
Author

Could be related to #503

@mkieselmann
Copy link
Author

mkieselmann commented Nov 21, 2020

Seems to be caused by MapboxMobileEvents changes to where the Info.plist is located. The current podspec only includes .h and .m files (see https://github.com/mapbox/mapbox-events-ios/blob/main/MapboxMobileEvents.podspec). This has change from version 0.10.4 to 0.10.5. The location of the Info.plist has also changed between versions.

I'll try with pod 'MapboxMobileEvents', '0.10.4'.

@mkieselmann
Copy link
Author

mkieselmann commented Nov 22, 2020

Using a fixed version of MapboxMobileEvents doesn't work either. The problem is probably related to the new Cocoapods version that doesn't need use frameworks! anymore. By default MapboxMobileEvents is linked statically while Mapbox.framework links it dynamically.

I've now remove Mapbox from my Podfile and installed the prebuild Frameworks manually.

@seanclin
Copy link

I believe this has something to do with XCode 12.2, I am able to build fine on 12.1 but my coworker is not able to build with 12.2

@Hless
Copy link

Hless commented May 31, 2021

I just ran into the same issue and the info.plist was literally missing from MapboxMobileEvents/Support Files Pod directory. I checked with co-workers who had the same XCode version, same OS, same CocoaPods version same lockfile, and they had the Info.plist. I checked our CI server (which does a clean reinstall with the same OS/CocoaPods/XCode versions too), also had the Info.plist.

So I Copied the Info.plist from a co-workers system to the Support Files directory on my system and added it in the settings of the MapboxMobileEvents target and everything started working again.

I'm at a complete loss why my system does not download this info.plist. It's the only file missing on my system, and cleaning derived data, the Pods directory and all other caches I can think of does not fix the problem. I simply don't understand why this is happening.

@Hless
Copy link

Hless commented May 31, 2021

Small update, I deleted the CocoaPods cache folder, ran pod clean --all just in case and did a repo update. Also installed pending brew updates and system updates. After all of those steps I did a pod deintegrate followed by pod install, now the Info.plist is correctly installed in the MapboxMobileEvents/Support Files directory.

Still not sure why this happens, but I suspect some problem with CocoaPods' caching system.

Edit
Versions for those wondering:
XCode 12.5
CocoaPods 1.10.1
MacOS Big Sur
iOS 14.5.1
MapBox SDK 6.3.0

@ghadeeraqraa1992
Copy link

The same issue
any help ?

@Hless
Copy link

Hless commented Jun 21, 2021

@ghadeeraqraa1992 Have you tried my solution? If you have this problem locally, you should remove all pod caches you can find ($HOME/Library/Caches/CocoaPods most notably), your Pods directory inside the project etc and reinitiate. It fixed the problem for me. The info.plist was literally missing in the Support Files of MapboxMobileEvents.

@ghadeeraqraa1992
Copy link

most

I tried the below steps :

  1. pod deintegrate
  2. pod clean
  3. pod install
    but the issue still appeared
    I will try remove all pod cashes and update you

@ghadeeraqraa1992
Copy link

@ghadeeraqraa1992 Have you tried my solution? If you have this problem locally, you should remove all pod caches you can find ($HOME/Library/Caches/CocoaPods most notably), your Pods directory inside the project etc and reinitiate. It fixed the problem for me. The info.plist was literally missing in the Support Files of MapboxMobileEvents.

I got the same issue

Could not install at this time. Failed to load Info.plist from bundle at path /Users/Ghadeer/Library/Developer/CoreSimulator/Devices/77062086-4859-4E6A-A712-B029E9DEF6C7/data/Library/Caches/com.apple.mobile.installd.staging/temp.sFhRhc/extracted/Payload/myApp.app/Frameworks/MapboxMobileEvents.framework; Extra info about plist: ACL=<not found>

any help ?

@Hless
Copy link

Hless commented Jun 21, 2021

Nothing I can do for you unfortunately. If you are sure you set the right version ($ReactNativeMapboxGLIOSVersion = '~> 6.3' in Podfile), and removed all related cache files (pods dir, pod caches, xcode build caches, derived files, possibly even podfile.lock), you should be able to resolve it. I suspect you could be missing some steps here.

Edit: Also, while it is my belief that it's undrelated, I also installed all homebrew, apple system updates and rebooted the system before reinstalling my pods. You never know, always worth a shot

@ghadeeraqraa1992
Copy link

Nothing I can do for you unfortunately. If you are sure you set the right version ($ReactNativeMapboxGLIOSVersion = '~> 6.3' in Podfile), and removed all related cache files (pods dir, pod caches, xcode build caches, derived files, possibly even podfile.lock), you should be able to resolve it. I suspect you could be missing some steps here.

Edit: Also, while it is my belief that it's undrelated, I also installed all homebrew, apple system updates and rebooted the system before reinstalling my pods. You never know, always worth a shot

could you please share your podfile , and @react-native-mapbox-gl/maps version ?

@Hless
Copy link

Hless commented Jun 21, 2021

Not the literal podfile since I have some custom stuff in there, but something similar to:

platform :ios, '11.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

$ReactNativeMapboxGLIOSVersion = '~> 6.3'

target "MyApp" do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )


  pre_install do |installer|
     $RNMBGL.pre_install(installer)
   end
  
   post_install do |installer|
     $RNMBGL.post_install(installer)
     react_native_post_install(installer)
   end
end

@react-native-mapbox-gl/maps version 8.2.0-beta2
RN 0.64

@ghadeeraqraa1992
Copy link

Not the literal podfile since I have some custom stuff in there, but something similar to:

platform :ios, '11.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

$ReactNativeMapboxGLIOSVersion = '~> 6.3'

target "MyApp" do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )


  pre_install do |installer|
     $RNMBGL.pre_install(installer)
   end
  
   post_install do |installer|
     $RNMBGL.post_install(installer)
     react_native_post_install(installer)
   end
end

@react-native-mapbox-gl/maps version 8.2.0-beta2
RN 0.64

my RN version is 0.63.4
should I upgrade to 0.64.0 ?

@Hless
Copy link

Hless commented Jun 21, 2021

Not likely related to the problem you are having, which I still believe is a caching problem. If I were you I would try to verify if the correct MapboxMobileEvents pod is loaded, the one where the Info.plist actually exists inside the MapboxMobileEvents/Support Files directory. As long as it doesn't you will keep having the problem. I can't help you any further, so I hope you can figure it out from here. Best of luck!

@Hless
Copy link

Hless commented Jun 21, 2021

Also, you can try to put the Info.plist there manually as I did, and verify if that fixes the problem. Then you actually have something to go on...

I'm talking about this one:
Screenshot 2021-06-21 at 14 05 19

With contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>CFBundleDevelopmentRegion</key>
  <string>en</string>
  <key>CFBundleExecutable</key>
  <string>${EXECUTABLE_NAME}</string>
  <key>CFBundleIdentifier</key>
  <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
  <key>CFBundleInfoDictionaryVersion</key>
  <string>6.0</string>
  <key>CFBundleName</key>
  <string>${PRODUCT_NAME}</string>
  <key>CFBundlePackageType</key>
  <string>FMWK</string>
  <key>CFBundleShortVersionString</key>
  <string>0.10.8</string>
  <key>CFBundleSignature</key>
  <string>????</string>
  <key>CFBundleVersion</key>
  <string>${CURRENT_PROJECT_VERSION}</string>
  <key>NSPrincipalClass</key>
  <string></string>
</dict>
</plist>

@ghadeeraqraa1992
Copy link

Also, you can try to put the Info.plist there manually as I did, and verify if that fixes the problem. Then you actually have something to go on...

I'm talking about this one:
Screenshot 2021-06-21 at 14 05 19

With contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>CFBundleDevelopmentRegion</key>
  <string>en</string>
  <key>CFBundleExecutable</key>
  <string>${EXECUTABLE_NAME}</string>
  <key>CFBundleIdentifier</key>
  <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
  <key>CFBundleInfoDictionaryVersion</key>
  <string>6.0</string>
  <key>CFBundleName</key>
  <string>${PRODUCT_NAME}</string>
  <key>CFBundlePackageType</key>
  <string>FMWK</string>
  <key>CFBundleShortVersionString</key>
  <string>0.10.8</string>
  <key>CFBundleSignature</key>
  <string>????</string>
  <key>CFBundleVersion</key>
  <string>${CURRENT_PROJECT_VERSION}</string>
  <key>NSPrincipalClass</key>
  <string></string>
</dict>
</plist>

there is no Info.plist

Screen Shot 2021-06-22 at 10 47 32 AM

I tried to add it manually but this doesn't fix the issue

@samuelcai-chancetop
Copy link

I had same issue, and I tried @Hless 's solution, but only did some of it: did a repo update, did a pod deintegrate followed by pod install.
It successes for the first time, but several hours later the info.plist is missing again (I can't remember what I did), and I tried same solution again, not working.
Last Friday the problem was still there, but today (this Monday), I did a regular "pod install", and found the info.plist was there. So I think it's related to cocoapod (especially cache). But I still don't know the root cause.

@Hless
Copy link

Hless commented Jul 26, 2021

@samuelcai-chancetop Glad to see that you got it working, albeit partially. I'm still very much confused why this happens. It hasn't happened to me for a long time now, nor did any of our CI tasks ever fail because of this issue. So I agree that this must be some sort of caching issue. Perhaps if you do all the steps it will fully fix it for you? I did verify the Pods cache when I first tried to fix it, and the info.plist was missing there too. Hence these suggestions.

@acoulon99
Copy link

acoulon99 commented Nov 28, 2021

I’m running into this similar issue from a React Native project. I’ve tried all suggestions including clearing the cocoapod cache, reinstalling cocoapods, clearing all build directories, and creating a new project from scratch. Going to keep digging and post anything definitive I find.

@wafisher
Copy link

wafisher commented Dec 4, 2021

I ran into a similar issue after upgrading CocoaPods. I'm pretty sure I ran the following commands and that was enough to break it. Clearing caches/etc has not fixed it. Only fix for me is manually installing the file where it needs to be and adding it to the XCode target.

gem list --local --no-version | grep cocoapods | xargs sudo gem uninstall
sudo gem install cocoapods

@DikshyaLimbu
Copy link

@Hless How did you add the info.plist from MapboxMobileEvents/Support Files to the MapboxMobileEvents target?

@wafisher
Copy link

It should prompt you when you drag the file into XCode

@ShevO27
Copy link

ShevO27 commented Apr 27, 2022

Hi, i've also encountered this issue on M1 mac, and i figured out to fix it with arch -x86_64 pod install, that was the only thing that helped. Upd: Sometimes a reboot of a mac before pod install is needed as well.

@wafisher
Copy link

wafisher commented Jun 21, 2022

More instructions that might be helpful:

Simulator

Copy original file into Pods project > Pods > MapboxMobileEvents > Support Files and make sure to add it to the target (MapboxMobileEvents) as you copy into XCode. You may have to get the version of this file that matches the version of the pod you use.

Device

This will get it to run on the Simulator but will give the following error on the device: "The code signature version is no longer supported." To get it to run on the device (and the Simulator), copy the file to the same folder and name it MapboxMobileEvents-Info.plist. (The renaming may not matter but this works.) You may have to get the text from here instead of the GitHub link.

Go to the Pods project and select the MapboxMobileEvents target. Make sure this plist file is recognized in the General tab (it will prompt you if it doesn't know where the main plist file is) then select "Automatically Manage Signing" to sign the code after building.

@mqzkim
Copy link

mqzkim commented Oct 4, 2022

I tried all the methods mentioned above, but they didn't work, and when I debugged all the Cocoapod and XcodeProj in Ruby, it was confirmed that the problem occurred due to the special setting. It may be a unique case, but it is very simple to check, so I recommend you to try it...

if ENV['INFOPLIST_FILE'] has a file for any Info.plist,
CocoaPods doesn't make Info.plist for Pod targets.
reference: https://github.com/CocoaPods/Xcodeproj/blob/29cd0821d47f864abbd1ca80f23ff2aded0adfed/lib/xcodeproj/project/object/build_configuration.rb#L115

I put this phrase in for the test and I was able to confirm that the file existed.
puts "#{ENV['INFOPLIST_FILE']}"

Finally, I could solved adding this line on top of Podfile.
ENV['INFOPLIST_FILE'] = nil

By the way, I don't know how I ended up assigning a specific Info.plist file to ENV...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants