rubymotion - 未定义方法 `[]' 为 nil :NilClass `read_provisioned_profile_array' on rake device mode=release in RubyMotion

标签 rubymotion

这里难住了...

我正在测试 ruby​​ motion 应用程序的 Release模式,但在尝试 rake device mode=release 时不断收到此错误

rake aborted!
undefined method `[]' for nil:NilClass
/Library/RubyMotion/lib/motion/project/template/ios/config.rb:128:in `read_provisioned_profile_array'
/Library/RubyMotion/lib/motion/project/template/ios/config.rb:133:in `provisioned_devices'
/Library/RubyMotion/lib/motion/project/template/ios.rb:208:in `block in <top (required)>'

我尝试了一些不同的方法,因为我假设这与我的配置文件有关。

  • 生成新证书
  • 生成新的配置文件
  • 注释掉整个开发 block

我完全被难住了,无法继续测试,直到我弄清楚为什么会出现此错误。有什么想法吗?

这是我的 Rakefile 以供引用:

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = 'Ultra App'
  app.deployment_target = "7.0"
  app.device_family = [:iphone]
  app.fonts = ['TitilliumWeb.ttf']
  app.icons = Dir.glob("resources/Icon*.png").map{|icon| icon.split("/").last} #['Icon.png', 'Icon@2x.png']
  app.seed_id = "QKKZN47C74"
  app.identifier = 'net.ultraapp'


  app.version = "1"
  app.short_version = "1.0.0"

  app.info_plist['APP_STORE_ID'] = 884636264
  app.info_plist['UIRequiredDeviceCapabilities'] = {
    'location-services' => true
  }



  app.development do
    app.codesign_certificate = "iPhone Developer: Seth Siegler (ZTGHVU7A3C)"
    app.provisioning_profile = "./environment/pre_release.mobileprovision"
    app.entitlements['aps-environment'] = 'development'
    app.entitlements['get-task-allow'] = true

    app.entitlements['application-identifier'] = app.seed_id + '.' + app.identifier
    app.entitlements['keychain-access-groups'] = [
    app.seed_id + '.' + app.identifier
  ]
  end

  app.interface_orientations = [:portrait]
  app.weak_frameworks += %w(AdSupport Accounts Social)
  app.frameworks += %w(CoreLocation MapKit StoreKit AudioToolbox CFNetwork SystemConfiguration 
    MobileCoreServices Security QuartzCore MessageUI CoreTelephony)
  app.vendor_project('vendor/Flurry', :static)
  #app.vendor_project('vendor/Parse.framework', :static, :products => ['Parse'], :headers_dir => 'Headers')
  app.pods do
     pod 'Facebook-iOS-SDK'
     pod 'SVProgressHUD'
     pod 'AWSiOSSDK'
  end
  #app.info_plist['FacebookAppID'] = '222889081226072'
  #app.info_plist['URL types'] = [{ 'URL Schemes' => ['fb222889081226072']}]
  app.release do
    app.codesign_certificate = "iPhone Distribution: Seth Siegler (QKKZN47C74)"
    app.provisioning_profile = "ultra_release.mobileprovision"
    app.info_plist['AppStoreRelease'] = true
    app.entitlements['get-task-allow'] = false 
  end
end

最佳答案

这发生在我身上,因为我使用的配置文件是企业配置文件。在开发构建中,如果指定了配置文件,它会查找 ProvisionedDevices 的键(不在企业配置文件中)。这会导致它破裂。

正在处理:https://github.com/HipByte/RubyMotion/pull/64

解决此问题的方法是不为开发构建提供企业配置文件。

编辑:确保您的预发布配置文件绑定(bind)了设备!

关于rubymotion - 未定义方法 `[]' 为 nil :NilClass `read_provisioned_profile_array' on rake device mode=release in RubyMotion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24473505/

相关文章:

ios - 在 Motion-Kit 布局中使用异步获取的数据

ios - 你能打开没有url方案的ios应用程序吗

http - 为什么我的 HTTP 请求(气泡包装)无法在 Grand Central Dispatch 队列中执行?

ios - RubyMotion Build : ERROR! 找不到名为 `(?-mix:iOS Team Provisioning Profile)' 的配置文件

ruby - 初始化 ruby​​ 单例

iphone - 如何在任何设备的 UIView 中间水平和垂直放置一个按钮?

objective-c - NSTokenField 点击完成列表项

iphone - 没有Ruby的RubyMotion这样的iOS构建系统?或者,RubyMotion是否可用于游戏?

ios - 如何为我的 iOS 导航栏创建水平渐变背景?

ios - 使用 CAKeyFrameAnimation(或其他东西?)使图像与 RubyMotion 反弹