我正在尝试在Xcode 9.4中安装OpenSSL Cocoapod,我得到以下内容:
[!] / bin / bash -c set -e VERSION =“1.0.2h”SDKVERSION =
xcrun --sdk iphoneos --show-sdk-version 2> /dev/null
MIN_SDK_VERSION_FLAG = “ - miphoneos版本分钟= 7.0”BASEPATH =“$ {PWD}”CURRENTPATH =“/ tmp / openssl”ARCHS =“i386 x86_64 armv7 armv7s arm64“DEVELOPER =
xcode-select -print-path
mkdir -p“$ {CURRENTPATH}”mkdir -p“$ {CURRENTPATH} / bin”
cp“file.tgz”“$ {CURRENTPATH} /file.tgz”cd“$ {CURRENTPATH}”tar -xzf file.tgz cd“openssl - $ {VERSION}”
for $ {ARCHS}中的ARCH执行CONFIGURE_FOR =“iphoneos-cross”
if [“$ {ARCH}”==“i386”] || [“$ {ARCH}”==“x86_64”];然后 PLATFORM = “iPhoneSimulator” if [“$ {ARCH}”==“x86_64”]; 然后 CONFIGURE_FOR = “darwin64-x86_64的-CC” 否则 sed -ie“s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!” “加密/ UI / ui_openssl.c” PLATFORM =“iPhoneOS”fi
出口 CROSS_TOP = “$ {开发人员} /平台/ $ {PLATFORM} .platform /开发者”
export CROSS_SDK =“$ {PLATFORM} $ {SDKVERSION} .sdk”echo“为$ {PLATFORM} $ {SDKVERSION}构建openssl - $ {VERSION} $ {ARCH}“echo”请等待......“
export CC =“$ {DEVELOPER} / usr / bin / gcc -arch $ {ARCH} $ {MIN_SDK_VERSION_FLAG}“mkdir -p “$ {} CURRENTPATH /斌/ $ {PLATFORM} $ {SDKVERSION} - $ {ARCH} .sdk”
LOG = “$ {CURRENTPATH} / bin中/ $ {PLATFORM} $ {SDKVERSION} - $ {ARCH} .sdk /集结的OpenSSL - $ {VERSION}的.log”LIPO_LIBSSL =“$ {LIPO_LIBSSL} $ {} CURRENTPATH /斌/ $ {PLATFORM} $ {SDKVERSION} - $ {ARCH} .sdk / lib目录/ libssl.a” LIPO_LIBCRYPTO =“$ {} LIPO_LIBCRYPTO $ {CURRENTPATH} / bin中/ $ {PLATFORM} $ {SDKVERSION} - $ {ARCH} .sdk / LIB / libcrypto.a“
./配置$ {CONFIGURE_FOR} --openssldir =“$ {CURRENTPATH} / bin / $ {PLATFORM} $ {SDKVERSION} - $ {ARCH} .sdk”> “$ {LOG}”2>& 1 sed -ie“s!^ CFLAG =!CFLAG = -isysroot $ {CROSS_TOP} / SDKs / $ {CROSS_SDK}!” “生成文件”
make>> “$ {LOG}”2>& 1 make all install_sw>> “$ {LOG}”2>& 1 make 清洁>> “$ {LOG}”2>& 1已完成
echo“构建库...”rm -rf“$ {BASEPATH} / lib /”mkdir -p “$ {BASEPATH} / lib /”lipo -create $ {LIPO_LIBSSL} -output “$ {BASEPATH} /lib/libssl.a”lipo -create $ {LIPO_LIBCRYPTO} -output “$ {基本路径} /lib/libcrypto.a”
echo“复制标题...”rm -rf“$ {BASEPATH} / opensslIncludes /”mkdir -p“$ {BASEPATH} / opensslIncludes /”cp -RL“$ {CURRENTPATH} / openssl - $ {VERSION} / include / openssl” “$ {基本路径} / opensslIncludes /”
cd“$ {BASEPATH}”echo“Building done。”
echo“正在清理......”rm -rf“$ {CURRENTPATH}”echo“完成。”
cp:file.tgz:没有这样的文件或目录
这是我在podfile中使用的命令:
pod 'OpenSSL', '~> 1.0'
我已经尝试安装Xcode命令行工具,但这并没有解决问题。
任何人都知道问题是什么?
答案 0 :(得分:1)
首先要做的事情:如果可以的话,尝试切换到不同的POD。那个不再维护。
如果无法切换,则解决方法:
curl https://www.openssl.org/source/openssl-<your-version>.tar.gz > file.tgz
cp file.tgz /tmp/openssl #create directory if needed
sed 's/cp \\"file.tgz\\" \\"${CURRENTPATH}\/file.tgz\\"//' `find ~/.cocoapods|grep "OpenSSL/<your-version>/OpenSSL.podspec.json"`
pod install
&#34;&LT;你的版本&gt;&#34;将是例如&#34; 1.0.2j&#34;对于URL和&#34; 1.0.210&#34;对于grep
答案 1 :(得分:1)
我也看到了这个问题。一直无法解决。令人沮丧的是,这是在Jenkins从属计算机上发生的-而我自己的Mac没有“ pod update”问题,并且似乎可以毫无问题地获得OpenSSL ...
此后我发现必须将cocoapod-downloader降级...才能安装... https://github.com/FredericJacobs/OpenSSL-Pod/issues/49
答案 2 :(得分:1)
用OpenSSL-XM替换Pod OpenSSL
或
在find〜/ .cocoapods | grep“ OpenSSL / 1.0.2j / OpenSSL.podspec.json”中替换“ prepare_command” 与https://github.com/CocoaPods/Specs/blob/3b17051d7e0bbb5c97420a7a6d3aa9b1f6b601db/Specs/3/2/e/OpenSSL-XM/1.0.210.1/OpenSSL-XM.podspec.json
答案 3 :(得分:0)
当我尝试安装其他cococapod时,出现了相同的错误。对我来说,解决方案是降级cococapods下载器。这是我使用的命令:
sudo gem uninstall cocoapods-downloader
sudo gem install cocoapods-downloader -v 1.2.0
Thnx
答案 4 :(得分:0)
帕特里克的答案对我有用。但是,为了使答案更清晰一点:
rm -rf /tmp/openssl; mkdir /tmp/openssl && cd /tmp/openssl;
curl https://www.openssl.org/source/openssl-1.0.2j.tar.gz > file.tgz
cd -;
sed -i 's/cp \\"file.tgz\\" \\"${CURRENTPATH}\/file.tgz\\"//' `find ~/.cocoapods|grep "OpenSSL/1.0.210/OpenSSL.podspec.json"`
pod install
注意:
pod install
在我的mac air上呆了大约10分钟。1.0.2j
和1.0.210
。cocoapods
降级,而cocoapods-downloader
是另一种解决方案,请参考here。答案 5 :(得分:0)
我研究了几种可能的解决方案,对我有用的一个解决方案是降级cocoapods和下载器。安装OpenSSL之后,可以完成Pod的安装,以恢复到当前的安装。确切步骤:
private const string _conversionCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public static string UlongToCompressedString(ulong number)
{
char[] charArray = _conversionCharacters.ToCharArray();
var buffer = new System.Text.StringBuilder();
var quotient = number;
ulong remainder;
while (quotient != 0)
{
remainder = quotient % (ulong)charArray.LongLength;
quotient = quotient / (ulong)charArray.LongLength;
buffer.Insert(0, charArray[remainder].ToString());
}
return buffer.ToString();
}
public static ulong? CompressedStringToULong(string compressedNumber)
{
if (compressedNumber == null)
return null;
if (compressedNumber.Length == 0))
return 0;
ulong result = 0;
int baseNum = _conversionCharacters.Length;
ulong baseMult = 1;
for (int i=compressedNumber.Length-1; i>=0; i--)
{
int cPos = _conversionCharacters.IndexOf(compressedNumber[i]);
if (cPos < 0)
return null;
result += baseMult * (ulong)cPos;
baseMult *= (ulong)baseNum;
}
return result;
}