iOS Build Environment Help Center

Update CocoaPods version

append delete Ruslan

Hello.

• Windows version: 10
• Builder version : 3.38/3.39
• iOS SDK version 14.5

After updating the admob version, I cannot build the project due to the problem shown below.
Tell me, can I update Cocoapods to the current version myself?
Thanks.

Analyzing dependencies
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`

CocoaPods 1.11.2 is available.
To update use: `sudo gem install cocoapods`

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.2

[!] `GoogleAppMeasurement` requires CocoaPods version `>= 1.10.2`, which is not satisfied by your current version, `1.10.1`.
=========================== CocoaPods output END ============================
NOTICE: this command returned a non-success exit status (1).

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

Instructions on how to upgrade CocoaPods are given in the documentation. See https://www.pmbaty.com/iosbuildenv/documentation/unity.html#cocoapods

Basically, open a command prompt, "cd" to where your Podfile is, and type

%
"%IOSUNITYBUILDER_PATH%\Toolchain\cocoapods\cocoapods.cmd" gem update cocoapods
%

Let me know if you need more help.

Best regards,

append delete #2. Ruslan

Thanks for the help, it worked for me.
Do you plan to update the CocoaPods version for the Cocoapods Daemon in the future?

Best regards.

append delete #3. Pierre-Marie Baty

FYI version 3.40 which I'm about to release will have CocoaPods upgraded to 1.11.2. As soon as I finish a last bugfix, I'll push it online.

Best regards,

append delete #4. Ruslan

Thank you for your work and prompt help.
I will wait for updates.

Best regards.

append delete #5. Sathyaraj

PS D:\UnityProjects\iosBuild> "%IOSUNITYBUILDER_PATH%\Toolchain\cocoapods\cocoapods.cmd" gem update cocoapods
At line:1 char:60
+ ... %IOSUNITYBUILDER_PATH%\Toolchain\cocoapods\cocoapods.cmd" gem update ...
+ ~~~
Unexpected token 'gem' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

Did I miss anything?

append delete #6. Pierre-Marie Baty

You're running this in PowerShell. .cmd scripts are not PowerShell scripts and need to be run in a *Command Prompt* (cmd.exe) window instead.

Note that the subsystem filesystem is readonly since a few releases, so if you want to update CocoaPods and make your changes persistent, you need to either remove the -snapshot flag from the script, or immediately issue a "pod install" command after your "gem update cocoapods" one, e.g. either do a

% from cmd.exe in your project directory
"%IOSUNITYBUILDER_PATH%\Toolchain\cocoapods\cocoapods.cmd" gem update cocoapods; pod install
%

or edit Toolchain\cocoapods\cocoapods.cmd and replace

% cocoapods.cmd
	echo CreateObject^("WScript.Shell"^).Run ".\cocoapods-daemon.exe -nodefaults -nographic !ACCEL_FLAG! -m !MAX_MEMORY!M -hda %COCOAPODS_IMG% -snapshot -net nic -net user,hostfwd=tcp::!LISTEN_PORT!-:22", 0 1> daemon-start.vbs & wscript daemon-start.vbs
%

with

%
	echo CreateObject^("WScript.Shell"^).Run ".\cocoapods-daemon.exe -nodefaults -nographic !ACCEL_FLAG! -m !MAX_MEMORY!M -hda %COCOAPODS_IMG% -net nic -net user,hostfwd=tcp::!LISTEN_PORT!-:22", 0 1> daemon-start.vbs & wscript daemon-start.vbs
%

Note the "-snapshot" flag was removed. This will make "gem update" changes persistent. P.S. There are 2 occurences of that flag in the cocoapods.cmd file.

The update is taking a bit longer than usual, sorry for that.

append delete #7. Sathyaraj

thanks for the reply using CMD I was able to update it

append delete #8. Pierre-Marie Baty

Version 3.40 is out with CocoaPods updated to 1.11.2. I guess this solves the issue.

append delete #9. Tobias

Hi, I updated my builder version because of the new upload procedure and I am facing problems with cocoapods. I am using builder version is 3.41, iOS SDK 14.5.

After installing the new build environment, I want to install cocoapods by calling cocoapods.cmd pod install. It downloads the BSD Unix filesystem which is about 350mb but then fails to start the daemon. I get a repeated error message saying wrong parameterformat - 850.

append delete #10. Pierre-Marie Baty

Which version of Windows ?

append delete #11. Tobias

Windows 10, 64Bit

append delete #12. Pierre-Marie Baty

I'm unable to reproduce that on a virgin Win10 x64 VM. Could you please post your logs on PasteBin ?

:: @Pierre-Marie Baty added on 12 Nov ’21 · 13:06

Also, what does the "chcp" command say when you type it in a command-line window ?

append delete #13. Tobias

Here it is after I downloaded the BSD Unix filesystem: https://pastebin.com/szqiu9cR

I guess I must have messed up something during the update process as I also can not build projects with my backup version (3.35.4) anymore even though I was able to do so before. Here the logs of an earlier version: https://pastebin.com/mX7Bkw0J

:: @Tobias added on 12 Nov ’21 · 14:21

chcp says "Active Codepage: 850."

append delete #14. Pierre-Marie Baty

Typically, we get this error message when we supply a wrong codepage number to the "chcp" command (such as "chcp gldfskjhglfds"). But 850 *is* a correct parameter, it's the ID of the Western European codepage, that the script uses. So everything happens as if Windows received a "chcp 850" command and replied "incorrect parameter". I'm totally clueless on why it would behave like that ! Do you have an idea on what you might have installed recently on your computer ? If not, consider a system restore...

append delete #15. Tobias

Very strange. The only program that comes to my mind would be KeePass for managing passwords. Uninstalling it did not solve my problem unfortunately. I will try to use a different computer over the weekend, if it works there I will use a restore point and see if that fixes the issue. Thank you so far.

append delete #16. Pierre-Marie Baty

OK, please let me know how it goes.

append delete #17. Tobias

Thanks for your help.

I managed to solve the problem and just built and uploaded a new version to the App Store.

This is what I tried but failed: First I tried installing/updating cocoapods on another computer, but strangely I got the same error message (wrong parameterformat - 850). Also using a restore point did not help unfortunately.

My solution: I ended up modifying the cocoapods.cmd and removed the chcp calls as they seemed to only be checking if the current codepage is correct. After that, the daemon started correctly again. Later I realized that my SDK was a little buggy so I updated it with the migration assistant. Now everything seems fine again.

append delete #18. Pierre-Marie Baty

Good to know you've got it working.

FYI these "chcp" calls are here because Microsoft's SSH tool, which is used to communicate with the CocoaPods VM in every single place of the script, ruthlessly changes the terminal codepage to UTF-8 (which is understandable) and simply omits to restore it to its previous value when it exits (which is wrong). Yet on some systems (e.g. Windows 7) the interpreter commands (e.g. "find") behave differently when the codepage in which we are is a Unicode one. And since the terminal codepage is preserved across scripts, when cocoapods.cmd returns to build.cmd I have to make sure it returns in the same codepage in which it was called, which is why I had to put these calls everywhere to mitigate the damage. It's probably not the right way of doing things, so I'll see if I can come up with something better.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty