XCode15, XCode16版本使用Cocoapods报错解决

magic
2024-10-23 / 0 评论 / 14 阅读 / 正在检测是否收录...

XCode15, XCode16版本使用Cocoapods报错解决

Xcode版本 Version 16.0 (16A242d)

新建一个项目bmob202407

1.界面加入一个按钮

Xnip2024-10-23_10-06-19.jpg

2.新增一个podfile文件

platform :ios, '11.0'  # Specify the platform and deployment target

target 'bmob202407' do
  pod 'BmobSDK'
end

3.安装pod

 pod install
Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

```
/Users/magic/.rbenv/versions/3.2.5/bin/pod install
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.15.2
        Ruby : ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [arm64-darwin24]
    RubyGems : 3.5.22
        Host : macOS 15.0.1 (24A348)
       Xcode : 16.0 (16A242d)
         Git : git version 2.39.5 (Apple Git-154)
Ruby lib dir : /Users/magic/.rbenv/versions/3.2.5/lib
Repositories : master - git - git@github.com:CocoaPods/Specs.git @ 3c25b942607c8dc669d5d708aeafaa9067522375

               trunk - CDN - https://cdn.cocoapods.org/
```

### Plugins

```
cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0
```

### Podfile

```ruby
platform :ios, '11.0'  # Specify the platform and deployment target

target 'bmob202407' do
  pod 'BmobSDK'
end
```

### Error

```
RuntimeError - `PBXGroup` attempted to initialize an object with unknown ISA `PBXFileSystemSynchronizedRootGroup` from attributes: `{"isa"=>"PBXFileSystemSynchronizedRootGroup", "exceptions"=>["3036C49C2CC74D2A00E71FAF"], "path"=>"bmob202407", "sourceTree"=>"<group>"}`
If this ISA was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:359:in `rescue in object_with_uuid'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:349:in `object_with_uuid'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:300:in `block (2 levels) in configure_with_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:299:in `each'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:299:in `block in configure_with_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:296:in `each'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:296:in `configure_with_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:272:in `new_from_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:350:in `object_with_uuid'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:290:in `block in configure_with_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:287:in `each'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project/object.rb:287:in `configure_with_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:272:in `new_from_plist'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:213:in `initialize_from_file'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/xcodeproj-1.25.1/lib/xcodeproj/project.rb:113:in `open'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1194:in `block (2 levels) in inspect_targets_to_integrate'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1193:in `each'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1193:in `block in inspect_targets_to_integrate'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:1188:in `inspect_targets_to_integrate'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:107:in `analyze'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:422:in `analyze'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:162:in `install!'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
/Users/magic/.rbenv/versions/3.2.5/lib/ruby/gems/3.2.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
/Users/magic/.rbenv/versions/3.2.5/bin/pod:25:in `load'
/Users/magic/.rbenv/versions/3.2.5/bin/pod:25:in `<main>'
```

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%60PBXGroup%60+attempted+to+initialize+an+object+with+unknown+ISA+%60PBXFileSystemSynchronizedRootGroup%60+from+attributes%3A+%60%7B%22isa%22%3D%3E%22PBXFileSystemSynchronizedRootGroup%22%2C+%22exceptions%22%3D%3E%5B%223036C49C2CC74D2A00E71FAF%22%5D%2C+%22path%22%3D%3E%22bmob202407%22%2C+%22sourceTree%22%3D%3E%22%3Cgroup%3E%22%7D%60%0AIf+this+ISA+was+generated+by+Xcode+please+file+an+issue%3A+https%3A%2F%2Fgithub.com%2FCocoaPods%2FXcodeproj%2Fissues%2Fnew&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

这个错误,你把项目转为组即可解决

1.打开你的 Xcode 项目。
2.在左侧的项目导航器中,右键点击项目文件夹(通常是项目名称)。
3.选择“Convert to Group”(转换为组)。

Xnip2024-10-23_09-50-08.jpg

继续pod install

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - Cocoapods not working in Xcode 16 macOS 15.0.1
   https://github.com/CocoaPods/CocoaPods/issues/12625 [open] [12 comments]
   a day ago

 - PBXFileSystemSynchronizedRootGroup causing pod init to fail with CocoaPods 1.15.2a
   https://github.com/CocoaPods/CocoaPods/issues/12627 [closed] [7 comments]
   a week ago

 - pod install has bug
   https://github.com/CocoaPods/CocoaPods/issues/10723 [closed] [33 comments]
   11 Jun 2024

and 2 more at:
https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unable%20to%20find%20compatibility%20version%20string%20for%20object%20version%20%6077%60.&type=Issues&utf8=✓

[!] [!] Xcodeproj doesn't know about the following attributes {"preferredProjectObjectVersion"=>"77"} for the 'PBXProject' isa.
If this attribute was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new

[!] [Xcodeproj] Xcode project version (77) is higher than the latest supported by xcodeproj (63).

错误已经发生改变, 提示我们本地Xcode版本77太高, pod最新版本最高支持63

1.找到并打开 `project.pbxproj` 文件,使用文本编辑器(如 sublime之类)。
    2.删除以下两行:
        minimizedProjectReferenceProxies = 1;
        preferredProjectObjectVersion = 77;
    3.更新以下行:
        objectVersion = 77; 
      修改为:
        objectVersion = 63;

提示安装成功

>bmob202407 pod install
Analyzing dependencies
Downloading dependencies
Installing BmobSDK (2.4.21)
Generating Pods project
Integrating client project

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

安装之后,真机可以,模拟器不行,提示

building for ios simulator but linking in object file built for ios m1

Xnip2024-10-23_10-58-31.jpg

这样设置即可解决,有更多问题也可以留言给我

0

评论

博主关闭了当前页面的评论