GithubHelp home page GithubHelp logo

Comments (7)

segiddins avatar segiddins commented on June 2, 2024

Please share steps to reproduce the issue, thanks!

from nanaimo.

mmerickel avatar mmerickel commented on June 2, 2024

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.

segiddins avatar segiddins commented on June 2, 2024

@mmerickel you should be setting it as a string

from nanaimo.

mmerickel avatar mmerickel commented on June 2, 2024

@segiddins It worked before upgrading.

from nanaimo.

segiddins avatar segiddins commented on June 2, 2024

Sorry, you're right. Can you share a code snippet that reproduces the problem?

from nanaimo.

mmerickel avatar mmerickel commented on June 2, 2024
#!/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.

segiddins avatar segiddins commented on June 2, 2024

Thanks!

from nanaimo.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.