vinivendra / Gryphon

The Swift to Kotlin translator.
https://vinivendra.github.io/Gryphon/
Other
609 stars 46 forks source link

initialize_from_file unknown #114

Open bryanaamot opened 2 years ago

bryanaamot commented 2 years ago

After running this: gryphon init SampleApp.xcodeproj/

I get this error:

Error making gryphon targets: Ruby version 3.1.1 /usr/local/Cellar/gryphon/0.18.1/libexec/vendor/gems/xcodeproj-1.16.0/lib/xcodeproj/project.rb:227:in initialize_from_file': [Xcodeproj] Unknown object version. (RuntimeError) from /usr/local/Cellar/gryphon/0.18.1/libexec/vendor/gems/xcodeproj-1.16.0/lib/xcodeproj/project.rb:112:inopen' from /Users/myusername/dev/test/SampleiOSApp/.gryphon/scripts/makeGryphonTargets.rb:11:in `

'

vinivendra commented 2 years ago

Hey @bryanaamot, thanks for opening this issue. I've looked at the Xcodeproj code to try to figure out what's going on, but didn't understand much.

Can you share more information about the app you're trying to initialize? What Xcode and Swift versions are you using? Is it just a clean Xcode template or did you make any changes to it? Were you following the steps in the tutorial?

dylandrones commented 2 years ago

I am seeing this same error message in Terminal. I was following the tutorial up until "Step 3: Initialization" when I got the following error in terminal:

MyAwesomeiOSApp % gryphon init MyAwesomeiOSApp.xcodeproj

Error making gryphon targets:
    Ruby version 2.6.8
Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0
Ignoring redcarpet-3.5.1 because its extensions are not built. Try: gem pristine redcarpet --version 3.5.1
Ignoring sassc-2.4.0 because its extensions are not built. Try: gem pristine sassc --version 2.4.0
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.19.0/lib/xcodeproj/project.rb:227:in `initialize_from_file': [Xcodeproj] Unknown object version. (RuntimeError)
    from /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.19.0/lib/xcodeproj/project.rb:112:in `open'
    from /Users/dylan/Desktop/MyAwesomeApp/MyAwesomeiOSApp/.gryphon/scripts/makeGryphonTargets.rb:11:in `<main>'

Environment: swift-driver version: 1.26.21 Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30) Target: x86_64-apple-macosx12.0

Xcode version 13.2.1 macOS Monterey Version 12.1

dylandrones commented 2 years ago

@bryanaamot, I Resolved the build issue by re-installing xcodeproj via sudo gem install xcodeproj, as stated in the tutorial.