realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.25k stars 2.14k forks source link

Can't update RealmSwift with CocoaPods #7118

Closed levelchanger closed 3 years ago

levelchanger commented 3 years ago

Cocoapods fails trying to install RealmSwift 10.5.2 when using pod update. It appears to be looking for RLMAccessor.h in the wrong directory.

Goals

Update to the latest RealmSwift and be able to build again in Xcode

Expected Results

Update to the RealmSwift 10.5.2 and be able to build again in Xcode

Actual Results

Here is the output from Terminal

Stack

   CocoaPods : 1.10.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
    RubyGems : 3.0.3
        Host : macOS 11.2.1 (20D74)
       Xcode : 12.4 (12D4e)
         Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '12.4'

target 'Takedown' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Takedown
    pod 'Firebase'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    pod 'Firebase/Auth'
    pod 'Firebase/Functions'
    pod 'Firebase/Analytics'
    pod 'Firebase/Database'
    pod 'Firebase/Storage'
    pod 'Firebase/RemoteConfig'
    pod 'Firebase/Crashlytics'
    pod 'Firebase/InAppMessaging'
    pod 'Harpy'
    pod 'SDWebImage/Core'
    pod 'FirebaseUI/Storage'
    pod 'UIImageColors'
    pod 'MBProgressHUD'
    pod 'TTOpenInAppActivity'
    pod 'YoutubePlayer-in-WKWebView'
    pod 'GoogleAPIClientForREST/YouTube'
    pod 'GoogleSignIn'
    pod 'CorePlot'
    pod 'Realm', '=10.5.2'
    pod 'RealmSwift', '=10.5.2'
    pod 'TwitterKit5'
    pod 'Purchases', '3.10.3'

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
        end
      end
    end
end

Error

Errno::ENOENT - No such file or directory @ realpath_rec - /Users/9a/Documents/CodingProjects/Takedown3.x/Pods/Realm/Realm/RLMAccessor.h
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/project.rb:326:in `realpath'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/project.rb:326:in `realpath'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/project.rb:326:in `reference_for_path'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/project.rb:269:in `add_file_reference'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:224:in `block (2 levels) in add_file_accessors_paths_to_pods_group'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:223:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:223:in `block in add_file_accessors_paths_to_pods_group'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:213:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:213:in `add_file_accessors_paths_to_pods_group'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:96:in `block in add_source_files_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:95:in `add_source_files_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:46:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:102:in `block in install_file_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:100:in `install_file_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:17:in `generate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:312:in `block in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/update.rb:63:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'## Steps for others to Reproduce

Don't know if it can be reproduced

Code Sample

N.A.

Version of Realm and Tooling

ProductName:    macOS
ProductVersion: 11.2.1
BuildVersion:   20D74

/Applications/Xcode.app/Contents/Developer
Xcode 12.4
Build version 12D4e

/usr/local/bin/pod
1.10.1
Realm (10.5.1)
RealmSwift (10.5.1)
Realm (= 10.5.1)
RealmSwift (= 10.5.1)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)

carthage not found
(not in use here)

/usr/bin/git
git version 2.24.3 (Apple Git-128)
dianaafanador3 commented 3 years ago

@levelchanger can you test doing a clean pod install, instead of using pod update. First run pod deintegrate and then instead of using the update command, run pod install --verbose. If you still get an error, can you paste the logs here? so we can continue to help you.

Jaycyn commented 3 years ago

I built a project yesterday with 10.5.2 in the podfile and it worked correctly. I also updated an existing project as well. I was using macOS 10.14.6 and then on a completely different Mac, used macOS 11

Your podfile has 'Realm' - remove that and try just RealmSwift

pod 'Realm', '=10.5.2'
pod 'RealmSwift', '=10.5.2'

Our pod just uses

pod 'RealmSwift', '>= 10.0.0'

levelchanger commented 3 years ago

@visdyn I have a mixed ObjC/Swift project so I need both SDKs.

@dianaafanador3 After following your instructions, the problem still exists. Here is the output podoutput.txt

Jaycyn commented 3 years ago

Is this the same issue as this https://github.com/realm/realm-cocoa/issues/6943

dianaafanador3 commented 3 years ago

As mentioned by @visdyn, referring to issue #6943, can you please clean your pod cache?

levelchanger commented 3 years ago

@visdyn, @dianaafanador3 Yes, it is the same problem and removing the pod cache and Xcode derived data fixed everything. Thank you!