記錄本身遇見的疑難雜症錯誤處理php
錯誤一 : lipo: -remove's specified would result in an empty fat file
ide
把生成的framework工程使用cocoapod依賴的時候,報這麼一個錯誤,尼瑪莫名奇妙。後來在stackOverFlow中找到了解決辦法。ui
So basically I found out that I just need to follow these simple steps.this
1. Create a cocoa touch framework. 2. Set bitcode enabled to No. 3. Select your target and choose edit schemes. Select Run and choose Release from Info tab. 4. No other setting required. 5. Now build the framework for any simulator as simulator runs on x86 architecture. 6. Click on Products group in Project Navigator and find the .framework file. 7. Right click on it and click on Show in finder. Copy and paste it in any folder, I personally prefer the name 'simulator'. 8. Now build the framework for Generic iOS Device and follow the steps 6 through 9. Just rename the folder to 'device' instead of 'simulator'. 10. Copy the device .framework file and paste in any other directory. I prefer the immediate super directory of both.
So the directory structure now becomes:spa
- Desktop - device - MyFramework.framework - simulator - MyFramework.framework - MyFramework.framework
Now open terminal and cd to the Desktop. Now start typing the following command:code
lipo -create 'device/MyFramework.framework/MyFramework' 'simulator/MyFramework.framework/MyFramework' -output 'MyFramework.framework/MyFramework'
and that's it. Here we merge the simulator and device version of MyFramework binary present inside MyFramework.framework. We get a universal framework that builds for all the architectures including simulator and device.ip
Now, creating a pod for this framework doesn't make any difference. It works like a charm. Please also note that there are run scripts available too to achieve the same functionality, but I spent a lot of time in finding the correct script. So I would suggest you use this method.ci
連接 :https://stackoverflow.com/questions/38670976/how-to-build-cocoa-touch-framework-for-all-architectures-dependent-on-other-fram。rem
仔細看最後lipo 合併命令是MyFramework.framework/MyFramework. 不然會報錯 lipo: can't map input file:XXX。 .framework實質是一個文件夾。terminal
錯誤二
Pods was rejected as an implicit dependency for 'libPods.a' because its architectures 'x86_64' didn't contain all required architectures 'i386',這種狀況其實就是pods的工程與主工程的valid Architectures 、 build active architecture Only 不一致致使。