Skip to content

从 archive 导出 ipa 包时失败 #1

Open
@qiubaiying

Description

@qiubaiying

十分感谢你提供的脚本!

我的Xcode版本是8.3和8.3.1
系统版本10.12.1

我从 archive 导出 ipa 包时发生了失败

2017-04-25 14:43:08.553 xcodebuild[31914:2514903] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/gq/mq8734y16zg2x8g_d10bbzvc0000gn/T/HLStore_2017-04-25_14-43-08.552.xcdistributionlogs'.
1.2.840.113635.100.1.61
2017-04-25 14:43:11.630 xcodebuild[31914:2514903] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fc6226e2e60>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.

Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}

** EXPORT FAILED **

google 了解决方法是

先运行下面的脚本

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
rvm use system

再导出 ipa包

不过在 *.sh 中rvm use system时,会出现下面的错误

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

google了很久,这个问题到现在还是很好的解决方法。
只能手动在终端中输入脚本进行打包~
希望能交流解决这个问题

Activity

jkpang

jkpang commented on Apr 26, 2017

@jkpang
Owner

你的电脑是安装了两个Xcode? 8.3和8.3.1? 导出ipa报错的原因: exportArchive: No applicable devices found 是没有找到合适的设备, 你卸载掉其中一个Xcode看看 @qiubaiying

qiubaiying

qiubaiying commented on Apr 26, 2017

@qiubaiying
Author
jkpang

jkpang commented on Apr 26, 2017

@jkpang
Owner

我这边使用完全没问题,你换一台可以打包的Mac看看能否成功, 我也去找找你出现错误的原因 @qiubaiying

jkpang

jkpang commented on Apr 26, 2017

@jkpang
Owner

错误信息再po多一点, mv: rename /Users/jarvi/Desktop/hysc-IPA/hysc.ipa to /Users/jarvi/Desktop/hysc-IPA/hysc-v1.0.2.ipa: No such file or directory上一句是export success 还是export failure ? 桌面的hysc-IPA文件夹里面有ipa文件吗 @lll1024

jkpang

jkpang commented on Apr 26, 2017

@jkpang
Owner

看一下这篇博客,和你遇到的问题是一样,进去后拉到文章最后: http://www.jianshu.com/p/722adedaa3bf @qiubaiying

qiubaiying

qiubaiying commented on Apr 26, 2017

@qiubaiying
Author

我在我的macBook上执行也是出现同样的错误。

能请问你的构建环境吗?

我的 xcodebuild 版本是

$ xcodebuild -version
Xcode 8.3.1
Build version 8E1000a

简书上的这篇文章也是用rvm ues system,但这样做就需要手动在终端输入,无法一次性打包完成。

jkpang

jkpang commented on Apr 27, 2017

@jkpang
Owner

我的 xcodebuild版本是:

Xcode 8.3.2
Build version 8E2002

1.你自己的MacBook有安装项目对应的签名证书吗?
2.你的开发者账号是哪一种类型?
3.在选择打包方式的时候选择的是以下哪种方式?

请选择打包方式(输入序号,按回车即可) 
 1. AdHoc 
 2. AppStore  
 3. Enterprise 

如果打包的类型和你的开发者账号类型不匹配,也有可能会失败. @qiubaiying

qiubaiying

qiubaiying commented on Apr 27, 2017

@qiubaiying
Author

打包的类型和你的开发者账号类型时一致的
我在运行脚本前输入rvm use system,就可以一次性打包成功了。

我在猜想是不是ruby版本的问题

macOS自带的ruby版本是2.0.0

$ rvm use system
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

我用rvm装的ruby是2.4.0

$ rvm use default
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]

请问你使用的ruby版本是多少呢?

jkpang

jkpang commented on Apr 27, 2017

@jkpang
Owner

恩恩,很有可能是和ruby的版本有关系,我前几天升级了最新的ruby
现在的版本和你一样
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
终于解决了啊,厉害👍 @qiubaiying

qiubaiying

qiubaiying commented on Apr 27, 2017

@qiubaiying
Author

惭愧惭愧,在这卡了很久了~
刚刚在进行了测试,在ruby 2.4.0以下的版本都是可以的。

$ rvm list known

# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.6]
[ruby-]2.3[.3]
[ruby-]2.4[.0]

现在已经切换到ruby2.3.3

$ rvm install ruby-2.3.3
$ rvm --default use 2.3.3

我是在重装Cocoapods的时候升级的ruby2.4.0,看来不能随便升级呀~

我建议你可以在脚本中加入将 ipa包 上传到 fir脚本命令的选项,这样就可以打包上传一次性解决了~

最后,再次感谢你抽出时间来帮我解决问题。

jkpang

jkpang commented on Apr 27, 2017

@jkpang
Owner

恩恩,,感觉每次Xcode升级都会带来一系列的坑😂 . ipa包上传fir.im和蒲公英,网上还是有很多资料的,我现在想把ipa直接传到公司自己的服务器,等搞好了我在弄上去

qiubaiying

qiubaiying commented on Apr 27, 2017

@qiubaiying
Author

😂同感同感~

muyang00

muyang00 commented on Apr 28, 2017

@muyang00

必须点个赞呢👍,可是这样打出来的包比原来xcode打的包足足大了7M,请问这是怎么回事

jkpang

jkpang commented on Apr 28, 2017

@jkpang
Owner

不会吧,,我的项目使用Xcode和脚本打出来的包都是同样大小 @muyang00

muyang00

muyang00 commented on May 2, 2017

@muyang00

在使用这个脚本过程中还发现个问题,目前我的ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
可是在公司账号下选择那个打包方式1,3,4情况下都会失败,都会提示说ruby版本过低;使用企业账号打包时1,2,3,4种情况都会失败。也是说ruby版本过低。
只有2是好的,可以打出IPA包
image33

20 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @chenxudongok@748781314@zhoujihang@JohnRayWong@WangGuibin

        Issue actions

          从 archive 导出 ipa 包时失败 · Issue #1 · jkpang/PPAutoPackageScript