Cronet on iOS build error

44 views
Skip to first unread message

aofen...@gmail.com

unread,
Jul 3, 2019, 6:36:19 AM7/3/19
to net-dev
When i follow this article [https://chromium.googlesource.com/chromium/src/+/master/components/cronet/ios/docs/BUILD.md]
to generate cronet library.Some error come out.


ERROR at //build/config/ios/ios_sdk.gni:96:21: Script returned non-zero exit code.
_ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope")
^----------
Current dir: /Users/kesonxie/Project/cronet/cronet_ios/src/out/Debug-iphonesimulator/
Command: python /Users/kesonxie/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py --get_sdk_info iphonesimulator
Returned 1.
stderr:

Traceback (most recent call last):
File "/Users/kesonxie/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 106, in <module>
FillXcodeVersion(settings, args.developer_dir)
File "/Users/kesonxie/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 58, in FillXcodeVersion
settings['xcode_version'] = FormatVersion(lines[0].split()[-1])
File "/Users/kesonxie/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 42, in FormatVersion
major, minor, patch = SplitVersion(version)
File "/Users/kesonxie/Project/cronet/cronet_ios/src/build/config/mac/sdk_info.py", line 29, in SplitVersion
version = version.split('.')
TypeError: a bytes-like object is required, not 'str'

See //remoting/remoting_enable.gni:8:3: whence it was imported.
import("//build/config/ios/ios_sdk.gni")
^--------------------------------------
See //BUILD.gn:22:1: whence it was imported.
import("//remoting/remoting_enable.gni")
^--------------------------------------


This seems like the current version of code not support python3. If i add the decode function before the strip function that can fix this problem.But another problem come out. Like bellow:

ERROR at //BUILD.gn:28:1: Unable to load "/Users/kesonxie/Project/cronet/cronet_ios/src/v8/gni/snapshot_toolchain.gni".
import("//v8/gni/snapshot_toolchain.gni")
^---------------------------------------

When i copy the "snapshot_toolchain.gni" to the folder an other error come out,
I don't know what i should do with this .

Misha Efimov

unread,
Jul 8, 2019, 10:11:37 AM7/8/19
to net-dev, aofen...@gmail.com
Hi Aofeng, unfortunately I've never seen this problem, but it looks like you might be missing some necessary dependencies.

I suggest to follow these instructions https://chromium.googlesource.com/chromium/src/+/master/docs/ios/build_instructions.md to ensure that you can build Chrome for iOS, and that should be sufficient to build Cronet for iOS as well.

aofen...@gmail.com

unread,
Jul 8, 2019, 10:36:28 PM7/8/19
to net-dev, aofen...@gmail.com
在 2019年7月8日星期一 UTC+8下午10:11:37,Misha Efimov写道:
Thank you .This is caused by python version. But I have met another touble,I used tag 65.0.3325.230 ,The Security.framework of iOS have conflict with the cronet code with redefinition "struct OpaqueSecTrustRef *' vs 'struct __SecTrust *", Do you know why?

Misha Efimov

unread,
Jul 9, 2019, 10:58:16 AM7/9/19
to aofen...@gmail.com, net-dev
I would suggest updating chromium checkout to current stable version, which is 75.0.3770.103.
The 65.0.3325.230 is almost 1 year old, and may not support current XCode and iOS SDK. 

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/ac707d25-b1c9-484c-bfc9-874611614b76%40chromium.org.

aofen...@gmail.com

unread,
Jul 15, 2019, 6:53:18 AM7/15/19
to net-dev, aofen...@gmail.com
在 2019年7月9日星期二 UTC+8下午10:58:16,Misha Efimov写道:
> To unsubscribe from this group and stop receiving emails from it, send an email to net...@chromium.org.
Thanks, I have another question about how can i pick out the cronet source code only for iOS ,so that i can develop in my own project.

Misha Efimov

unread,
Jul 15, 2019, 10:35:26 AM7/15/19
to aofen...@gmail.com, net-dev
Cronet source code is in //components/cronet, but unfortunately there is no simple way to isolate its dependencies from the rest of the Chrome source code.


--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/fba7c032-87b1-40f8-a834-51ad61c86821%40chromium.org.
Reply all
Reply to author
Forward
0 new messages