I first noticed the problem on CI when trying to prepare an iOS project on a new machine, but in order to exclude being a problem with the CI itself I managed to find a way to reproduce it also on my local machine:
mv ~/.cocoapods ~/.cocoapods.bkpmv ~/Library/Caches/CocoaPods ~/Library/Caches/CocoaPods.bkptns create Testtns plugin add nativescript-plugin-firebasetns prepare ios --log traceThis fails with the following error on my local machine, which looks like normal git output, not an error:
Pod install command failed. Error output: Cloning into 'master'...
remote: Counting objects: 2221781, done.
remote: Compressing objects: 100% (480/480), done.
remote: Total 2221781 (delta 237), reused 248 (delta 99), pack-reused 2221183
Receiving objects: 100% (2221781/2221781), 546.46 MiB | 7.19 MiB/s, done.
Resolving deltas: 100% (1270873/1270873), done.
Checking out files: 100% (245557/245557), done.
On our CI machine the error is more detailed, but still looks like normal git output.
Versions:
nativescript: 4.0.2
tns-ios: 4.0.1
$ pod --version
1.5.3
I've just upgraded to the latest nativescript version and the problem persists 馃槩
@rosen-vladimirov, any ideas what I can try next ?
I've tested now on the newer NativeScript 4.2.3 version and the problem is still here 馃槥
nativescript: 4.2.3
tns-ios: 4.2.0
MacOS: Sierra v10.12.6 (16G1510)
XCode: 9.2 (9C40b)
$ pod --version
1.5.3
This is really blocking our CI efforts 馃槥
I think this is happening to me too in my CI environment. I am using Bitrise and I don't get a detailed error message but I do get the Pod install command failed message. This is probably due to Bitrise dropping something in the message. I can build locally. @surdu - have you had any luck on fixing this?
@vtjon Nope!
I think I narrowed down what is going on with my environment. I have nstudio/camera-plus and the nativescript-imagepicker in my project. I get a couple of warnings that appear to crash the prepare process. The pertinent part is:
Pod installation complete! There are 17 dependencies from the Podfile and 26 total pods installed.
[WARNING]: /usr/local/lib/ruby/gems/2.5.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/document.rb:44: warning: constant ::Fixnum is deprecated
[WARNING]: [!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
[WARNING]: [!] There are duplicate dependencies on `QBImagePickerController` in `Podfile`:
Pod install command failed. Error output:
QBImagePickerController
- QBImagePickerController (~> 3.4.0)
I am not sure if this should be a fatal error or not.
Hey guys,
We have reproduced the issue and it seems Cocoapods print warnings that CLI detects as errors. May I ask you to try the following fix:
which tns should help you).<nativescript installation dir>/lib/services/ios-project-service.js file and open it.executePodInstall method and change this line:const childProcess = yield this.$childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: this.getPlatformData(projectData).projectRoot, stdio: ['pipe', process.stdout, 'pipe'] });
to:
const childProcess = yield this.$childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: this.getPlatformData(projectData).projectRoot, stdio: ['pipe', process.stdout, 'pipe'] }, { throwError: false });
This should trigger special logic in CLI to try parsing the data from stderr of pod install command and it could resolve your issue.
Can you please give it a try and inform us if it resolves your issue?
@rosen-vladimirov I am not going to be able to try this solution at this time as it was only happening in my cloud CI environment (bitrise) and I managed the clear the warnings so I could finally build. Thanks for your response though. Hopefully surdu can try.
@rosen-vladimirov Tried it on my local machine and doesn't appear to fix the issue, as finally I still get:
Pod installation complete! There are 12 dependencies from the Podfile and 24 total pods installed.
Unable to apply changes on device: 50CA1550-791F-4C50-A1FA-619D5A40D917. Error is: Pod install command failed. Error output: Cl
oning into 'master'...
remote: Counting objects: 2444211, done.
remote: Compressing objects: 100% (429/429), done.
remote: Total 2444211 (delta 178), reused 35 (delta 35), pack-reused 2443732
Receiving objects: 100% (2444211/2444211), 572.19 MiB | 4.18 MiB/s, done.
Resolving deltas: 100% (1421309/1421309), done.
Checking out files: 100% (267832/267832), done.
.
Here is another interesting part when using --log trace:
Pod installation complete! There are 12 dependencies from the Podfile and 24 total pods installed.
Result when throw error is false:
{ stdout: '',
stderr: ' Cloning into \'master\'...\n remote: Counting objects: 2443732
[...]
Checking out files: 100% (267858/267858), done.\n',
exitCode: 0
}
Shouldn't that cloning info message be in stdout not stderr ?
Complete log can be found here.
Hey @surdu ,
Thanks for trying the fix. Yeah, these lines should be on stdout, but it looks like they are on stderr. You can try executing pod setup && pod repo update in your terminal, which should execute the failing git clone. After that you should be able to execute tns run ios for your project.
@rosen-vladimirov This solves the problem for my machine, but the one on the CI appears to still persist.
Here is the full output from the CI: https://pastebin.com/raw/rPD76Rgm
Please note that the pod setup and pod repo update where executed in a previous step not pressent in the above logs.
Hey @surdu ,
It looks like your cocoapods repo is messed on the CI machine. Can you try executing:
$ rm -rf ~/.cocoapods/repos/master
$ pod setup
$ pod repo update
@rosen-vladimirov That doesn't seem to solve the issue :(
@rosen-vladimirov BUT the more drastic measure of deleting the whole ~/.cocoapods and ~/Library/Caches/CocoaPods did fix it 馃帀
Most helpful comment
@rosen-vladimirov BUT the more drastic measure of deleting the whole
~/.cocoapodsand~/Library/Caches/CocoaPodsdid fix it 馃帀