Skip to content

ObjectBoxGeneratorCommand doesn't recognise entity files #108

@kemkriszt

Description

@kemkriszt

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions