Skip to content

Error running ObjectBoxGeneratorCommand with objectbox via xcode #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
angelocarasig opened this issue Apr 7, 2025 · 2 comments
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@angelocarasig
Copy link

Is there an existing issue?

Build info

  • ObjectBox version: 4.1.0-beta.2
  • OS: iOS18
  • Device/chipset: iPhone 16

Steps to reproduce

TODO Tell us exactly how to reproduce the problem.

  1. Create a new xcode App
  2. Go to File -> Add Package Dependency
  3. Paste in https://github.com/objectbox/objectbox-swift-spm and set dependency rule to Next Major Version, set the version to 4.1.0-beta.2
  4. Add package and set target to the created xcode project
  5. Right click project and run the ObjectBoxGeneratorCommand

Expected behavior

The generator to run with no errors

Actual behavior

A crash.

Logs, stack traces

Running the setup.rb file similarly with the cocoapods approach nets me an error log like below with a more detailed idea on whats happening but unsure how to fix it

Logs
🔸 Looking for project files in the current directory ...
🔸 Found a single project.
🔸 Using "/Users/User/Repositories/Project/Project/Project.xcodeproj"
🔹 Adding a new group for generated files at `./generated/`...
Pods/ObjectBox/setup.rb:225:in `block in <main>': undefined method `name' for #<Xcodeproj::Project::Object::PBXFileSystemSynchronizedRootGroup:0x0000000124a39cb8> (NoMethodError)
	from Pods/ObjectBox/setup.rb:225:in `index'
	from Pods/ObjectBox/setup.rb:225:in `<main>'
@angelocarasig angelocarasig added the bug Something isn't working label Apr 7, 2025
@greenrobot-team greenrobot-team added this to the 4.2.0 milestone Apr 8, 2025
@greenrobot-team greenrobot-team self-assigned this Apr 8, 2025
@greenrobot-team
Copy link
Member

Thanks for reporting! This is a known issue when using an Xcode 16 project that uses buildable folders instead of groups (in the Xcode 16 release notes search for "Buildable folders").

For our reference, this is internal issue objectbox-swift#308

@greenrobot-team greenrobot-team removed this from the 4.2.0 milestone Apr 15, 2025
@greenrobot-team
Copy link
Member

This will be fixed with an upcoming version as it requires major changes to the ObjectBox generator.

Until then, we recommend to stick to the Xcode 15.3 project format.

If you already have created or upgraded to an Xcode 16 project, you can change the format in the Project Navigator pane (on the right) after clicking on the project. Also make sure to convert any folders to groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants