objectbox / objectbox/objectbox-swift

ObjectBoxGeneratorCommand doesn't recognise entity files

Open
#108 4 comments 0 reactions 1 assignee View on GitHub

@greenrobot-team is already working on this.

Since Oct 1, 2025.

bug
Dominant language
Swift
Stars
619
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Is there an existing issue?
Build info
  • ObjectBox version: 4.4.1
  • OS: running on macOS 15.7, project targets iOS 17
  • Device/chipset: M1 Pro
Steps to reproduce
  1. Reintegrate Cocoapods from existing project, remove all files and build step for auto generation
  2. Add objectbox SPM
  3. Ensured I don't have any Folders, only Groups
  4. Run ObjectBoxGeneratorCommand plugin
Expected behavior

Source files are correctly autogenerated

Actual behavior

All enttiy data is removed from the EntityInfo-* file.
For example, cModel looks like this:

fileprivate func cModel() throws -> OpaquePointer {
    let modelBuilder = try ObjectBox.ModelBuilder()
    // Previously had ~15 x try SomeEntity.buildEntity(modelBuilder: modelBuilder)
    modelBuilder.lastEntity(id: 27, uid: 5950384143574972928)
    modelBuilder.lastIndex(id: 36, uid: 8353492716365687552)
    modelBuilder.lastRelation(id: 8, uid: 5131698544966963456)
    return modelBuilder.finish()
}
Logs, stack traces

Logs of the plugin:


Showing Recent Messages
working directory:
   /path/to/project
tool mapping:
   objectbox-generator: /path/to/packages/SourcePackages/artifacts/objectbox-swift-spm/ObjectBoxGenerator/Contents/MacOS/Sourcery [arm64-apple-macosx]
tool paths:
   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
   /Applications/Xcode.app/Contents/Developer/usr/bin
   /bin
   /sbin
   /usr/bin
   /usr/sbin

No config file or project path provided or it does not exist. Using command line arguments.
Scanning sources...
Found 2217 types in 1383 files, 1383 changed from last run.
note: ObjectBox ID Model file changed: model-Target.json, creating backup file (.bak).
Loading templates...
Loaded 1 templates.
Generating code...
Finished.
Done.

2025-09-25 14:33:06.073 Sourcery[13531:935145] NetworkStorageDB:_openDBReadConnections: failed to open read connection to DB @ /Users/x/Library/Caches/$(PRODUCT_BUNDLE_IDENTIFIER)/Cache.db.  Error=14. Cause=unable to open database file
2025-09-25 14:33:06.073 Sourcery[13531:935145] The read-connection to the DB=/Users/x/Library/Caches/$(PRODUCT_BUNDLE_IDENTIFIER)/Cache.db is NOT valid.  Unable to determine schema version.
2025-09-25 14:33:06.073 Sourcery[13531:935145] NetworkStorageDB:_openDBWriteConnections: failed to open write connection to DB @ /Users/x/Library/Caches/$(PRODUCT_BUNDLE_IDENTIFIER)/Cache.db.  Error=14. Cause=unable to open database file
2025-09-25 14:33:06.073 Sourcery[13531:935145] DEBUG: there is no SQL cache DB located at /Users/x/Library/Caches/$(PRODUCT_BUNDLE_IDENTIFIER)/Cache.db.
2025-09-25 14:33:06.073 Sourcery[13531:935145] DEBUG: there is no SQL cache DB located at /Users/x/Library/Caches/$(PRODUCT_BUNDLE_IDENTIFIER)/Cache.db-shm.
2025-09-25 14:33:06.073 Sourcery[13531:935145] DEBUG: there is no SQL cache DB located at /Users/x/Library/Caches/$(PRODUCT_BUNDLE_IDENTIFIER)/Cache.db-wal.

🟩 The plugin execution finished.
! Add the generated source file in 'generated/EntityInfo-Target.generated.swift' to the project and version control
! Add the generated model file in 'model-Target.json' to version control, this is important for ObjectBox model generation

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.