Comments (7)
Please share steps to reproduce the issue, thanks!
from nanaimo.
I just ran into this (similar) issue because I was passing a Pathname
object to a Xcodeproj::Project::Object::XCConfigurationList#build_configuration_list#set_setting
. It appears the Nanaimo::Writer#write_object
method is quite strict on what it accepts and may need to be relaxed.
from nanaimo.
@mmerickel you should be setting it as a string
from nanaimo.
@segiddins It worked before upgrading.
from nanaimo.
Sorry, you're right. Can you share a code snippet that reproduces the problem?
from nanaimo.
#!/usr/bin/env ruby
require 'pathname'
require 'xcodeproj'
project_path = Pathname.new('DummyProject.xcodeproj')
plist_path = Pathname.new('DummyProject/Info.plist')
project = Xcodeproj::Project.new(project_path)
target = project.new_resources_bundle('DummyProjectBundle', :ios)
target.build_configuration_list.set_setting('INFOPLIST_FILE', plist_path)
project.save
produces the following stacktrace:
/Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:63:in `write_object': Cannot write DummyProject/Info.plist to an ascii plist (RuntimeError)
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:140:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:41:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:119:in `block in write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:118:in `each'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:118:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:19:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:55:in`write_object'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:140:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:41:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:119:in `block in write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:118:in `each'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:118:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:19:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:55:in`write_object'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:140:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:41:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:29:in `block (2 levels) in write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:28:in `each'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:28:in `block in write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:24:in `each'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:24:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:55:in`write_object'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:140:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:41:in `write_dictionary_key_value_pair'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:119:in `block in write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:118:in `each'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:118:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/xcode_project_writer.rb:19:in `write_dictionary'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:55:in`write_object'
from /Users/michael/.gem/ruby/2.0.0/gems/nanaimo-0.1.4/lib/nanaimo/writer.rb:29:in`write'
from /Users/michael/.gem/ruby/2.0.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:353:in `block in save'
from /Users/michael/.gem/ruby/2.0.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:353:in `open'
from /Users/michael/.gem/ruby/2.0.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:353:in `save'
from ./reproduce_8.rb:14:in `<main>'
However, using plist_path.to_s
fixes it.
from nanaimo.
Thanks!
from nanaimo.
Related Issues (13)
- Delete all *Helper classes HOT 1
- Can not parse unqouted attribute strings with - HOT 3
- Update README HOT 3
- misleading error message for invalid pbxproj - ParseError - [!] Array missing ',' in between objects - HOT 3
- Nanaimo parse error HOT 8
- Failing to write following example with `write': undefined method `root_object' HOT 1
- Invalid character "@" in unquoted string HOT 5
- Ruby 2.7 Deprecations HOT 1
- Provide line number in error messages HOT 2
- uninitialized constant Nanaimo::Writer::XMLWriter::Date HOT 3
- Cut a new release HOT 2
- Nanaimo can't parse binary plist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanaimo.