首页 > 解决方案 > 无法从路径 Frameworks/RCTVibration.framework/Info.plist 的包中加载 Info.plist:没有这样的文件或目录(React Native)

问题描述

我已经有几个小时的问题了,我不知道它是从哪里来的,我要开始哭了。

在模拟器上启动应用程序时,在我的 Xcode 构建结束时出现的错误:

Failed to load Info.plist from bundle at path /INSERT A BIG PATH HERE/Frameworks/RCTVibration.framework; 

Couldn't stat /INSERT A BIG PATH HERE/RCTVibration.framework/Info.plist: No such file or directory

我已经尝试了几次:

这是我的 Podfile:

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

platform :ios, '11.0'

target 'X' do
  config = use_native_modules!
  use_frameworks!
  
  # Convert all permission pods into static libraries
  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

    installer.pod_targets.each do |pod|
      if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-') || pod.name.eql?('RNScreens')
        def pod.build_type;
          Pod::BuildType.static_library # >= 1.9
        end
      end
    end
  end
  
  pod 'X'
  pod 'Firebase/Crashlytics'
  # Recommended: Add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'

  
  use_react_native!(
    :path => config[:reactNativePath]
  )
  
  rn_maps_path = '../node_modules/react-native-maps'
#  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"

  post_install do |installer|
    react_native_post_install(installer)
  
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
    
      if (target.name&.eql?('FBReactNativeSpec'))
        target.build_phases.each do |build_phase|
          if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
            target.build_phases.move(build_phase, 0)
          end
        end
      end
    end
  end

end

这些操作都不起作用,所以如果您有任何想法,我很感兴趣

编辑:我刚刚用临时/缓存文件干净地卸载了 XCode 并重新安装,注意在编译之前从模拟器中删除所有数据,但同样的问题。

标签: xcodereact-nativexcode12

解决方案


推荐阅读