ios App不能联网【麻烦引擎组的同学看看】

cocos版本:1.7.2,
平台:mac
我们制作的app在调试阶段是可以联网的,但是发布到苹果商店之后下载下来某些机器就不能联网,比如外行的iphoneX,
觉得可能是这一段代码引起的,


,但是不知道具体是什么情况,下面是具体的报错信息:

1赞

默认 15:48:53.479395 +0700 GAME-mobile Retrieving resting unlock: 0
默认 15:48:53.508972 +0700 GAME-mobile info: CocosAnalytics ==> enableLoggin
默认 15:48:53.927512 +0700 GAME-mobile ========CFBundleIdentifier================com.shell.xbsh
默认 15:48:54.133759 +0700 GAME-mobile Faulting in NSHTTPCookieStorage singleton
默认 15:48:54.133836 +0700 GAME-mobile Faulting in CFHTTPCookieStorage singleton
默认 15:48:54.133918 +0700 GAME-mobile Creating default cookie storage with default identifier
默认 15:48:54.135006 +0700 GAME-mobile TIC TCP Conn Start [1:0x1d017b000]
默认 15:48:54.135321 +0700 GAME-mobile Task .<0> setting up Connection 1
默认 15:48:54.135410 +0700 GAME-mobile TIC TCP Conn Start [2:0x1d017b240]
默认 15:48:54.135772 +0700 GAME-mobile Task <70FA033E-50A0-4D39-8B41-68B893A74156>.<0> setting up Connection 2
默认 15:48:54.137164 +0700 GAME-mobile TIC TCP Conn Event [1:0x1d017b000]: 3
错误 15:48:54.137232 +0700 GAME-mobile TIC TCP Conn Failed [1:0x1d017b000]: 1:50 Err(50)
默认 15:48:54.137322 +0700 GAME-mobile TIC TCP Conn Cancel [1:0x1d017b000]
默认 15:48:54.138146 +0700 GAME-mobile _CFNetworkIsConnectedToInternet returning 0, flagsValid: 1, flags: 0x40000
默认 15:48:54.138612 +0700 GAME-mobile CCMonitor created
默认 15:48:54.141220 +0700 GAME-mobile Data status:
错误 15:48:54.141396 +0700 GAME-mobile Task .<0> HTTP load failed (error code: -1009 [1:50])
默认 15:48:54.142392 +0700 GAME-mobile TIC TCP Conn Event [2:0x1d017b240]: 3
错误 15:48:54.142515 +0700 GAME-mobile TIC TCP Conn Failed [2:0x1d017b240]: 1:50 Err(50)
默认 15:48:54.142627 +0700 GAME-mobile TIC TCP Conn Cancel [2:0x1d017b240]
错误 15:48:54.142851 +0700 GAME-mobile NSURLConnection finished with error - code -1009
默认 15:48:54.143460 +0700 GAME-mobile _CFNetworkIsConnectedToInternet returning 0, flagsValid: 1, flags: 0x40000
默认 15:48:54.145551 +0700 GAME-mobile Data status:
错误 15:48:54.145695 +0700 GAME-mobile Task <70FA033E-50A0-4D39-8B41-68B893A74156>.<0> HTTP load failed (error code: -1009 [1:50])
错误 15:48:54.148102 +0700 GAME-mobile NSURLConnection finished with error - code -1009

我也遇到过这个问题,不是必现的,好难找到问题的根源阿~

搞错了,是国行手机

顶起来

我也遇到了类似的问题,求解决方案呀

@引擎组同学看看啊~

嗯嗯,蟹蟹啦

@panda 大大 来看看啊~

默认 17:27:56.591917 +0700 GAME-mobile error: CocosAnalytics ==> Please init SDK first!
默认 17:28:00.321077 +0700 GAME-mobile subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:28:00.325717 +0700 GAME-mobile subsystem: com.apple.UIKit, category: HIDEventIncoming, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:28:00.326144 +0700 GAME-mobile subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
默认 17:28:00.339389 +0700 GAME-mobile subsystem: com.apple.UIKit, category: StatusBar, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:28:00.343181 +0700 GAME-mobile subsystem: com.apple.BackBoardServices.fence, category: App, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
默认 17:28:00.463007 +0700 GAME-mobile info: CocosAnalytics ==> enableLoggin
默认 17:28:00.655218 +0700 GAME-mobile subsystem: com.apple.libsqlite3, category: logging, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:28:01.649656 +0700 GAME-mobile subsystem: com.apple.BackBoardServices.fence, category: Workspace, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
默认 17:28:01.886980 +0700 GAME-mobile ========CFBundleIdentifier================com.shell.xbsh
默认 17:28:02.891351 +0700 GAME-mobile Faulting in NSHTTPCookieStorage singleton
默认 17:28:02.892462 +0700 GAME-mobile Faulting in CFHTTPCookieStorage singleton
默认 17:28:02.892842 +0700 GAME-mobile Creating default cookie storage with default identifier
默认 17:28:02.902238 +0700 GAME-mobile subsystem: com.apple.network, category: , enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
默认 17:28:02.906745 +0700 GAME-mobile TIC TCP Conn Start [2:0x174198050]
默认 17:28:02.907544 +0700 GAME-mobile TIC TCP Conn Start [1:0x170197f80]
默认 17:28:03.089508 +0700 GAME-mobile TIC TCP Conn Event [2:0x174198050]: 1 Err(0)
默认 17:28:03.089595 +0700 GAME-mobile TIC TCP Conn Connected [2:0x174198050]: Err(0)
默认 17:28:03.090310 +0700 GAME-mobile TIC TCP Conn Event [1:0x170197f80]: 1 Err(0)
默认 17:28:03.090377 +0700 GAME-mobile TIC TCP Conn Connected [1:0x170197f80]: Err(0)
默认 17:28:05.091343 +0700 GAME-mobile TIC TCP Conn Cancel [2:0x174198050]
默认 17:28:05.093747 +0700 GAME-mobile TIC TCP Conn Cancel [1:0x170197f80]
默认 17:29:05.723964 +0700 GAME-mobile subsystem: com.apple.UIKit, category: Touch, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:29:05.724618 +0700 GAME-mobile subsystem: com.apple.UIKit, category: Gesture, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:29:05.728992 +0700 GAME-mobile subsystem: com.apple.UIKit, category: GestureEnvironment, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
默认 17:29:05.729459 +0700 GAME-mobile subsystem: com.apple.UIKit, category: GestureExclusion, enable_level: 0, persist_level: 0, default_ttl: 1, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0

这另一个手机的日志

顶起来

顶起来

未上架的也出现问题了:
2018-01-18 18:47:27.659678 GAME-mobile[260:17265] [DYMTLInitPlatform] platform initialization successful
2018-01-18 18:47:28.041846 GAME-mobile[260:17017] info: CocosAnalytics ==> enableLoggin
2018-01-18 18:47:28.158575 GAME-mobile[260:17017] Metal GPU Frame Capture Enabled
2018-01-18 18:47:28.159162 GAME-mobile[260:17017] Metal API Validation Enabled

{
gl.supports_OES_map_buffer: true
gl.supports_vertex_array_object: true
cocos2d.x.version: 1.7.0
gl.vendor: Apple Inc.
gl.supports_PVRTC: true
gl.renderer: Apple A9 GPU
cocos2d.x.compiled_with_profiler: false
gl.version: OpenGL ES 2.0 Metal - 33
gl.max_texture_size: 4096
gl.supports_ETC1: false
gl.supports_BGRA8888: false
cocos2d.x.build_type: DEBUG
gl.max_texture_units: 8
gl.max_samples_allowed: 4
gl.supports_OES_packed_depth_stencil: true
gl.supports_NPOT: true
gl.supports_discard_framebuffer: true
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_OES_depth24: true
}

Initializing JavaScriptCore
cocos2d: fullPathForFilename: No file found at script/jsb_prepare.jsc. Possible missing file.
cocos2d: fullPathForFilename: No file found at script/jsb_boot.jsc. Possible missing file.
JS: Cocos2d-x-lite v1.7.0
2018-01-18 18:47:28.979388 GAME-mobile[260:17017] cocos2d: surface size: 1334x750
cocos2d: QuadCommand: resizing index size from [-1] to [2560]
2018-01-18 18:47:29.167765 GAME-mobile[260:17017] cocos2d: surface size: 1334x750
JS: LoadScene 56UinExqFJiIFyZKJNoxgh: 219.96900000000005ms
JS: InitScene: 12.405999999999949ms
JS: AutoRelease: 0.30500000000006366ms
JS: Destroy: 0.08299999999996999ms
JS: Success to load scene: db://assets/scene/start.fire
JS: AttachPersist: 0.005999999999971806ms
JS: [WARN]: Sorry, lineHeight of system font not supported on JSB.
JS: [WARN]: Sorry, lineHeight of system font not supported on JSB.
JS: [WARN]: Sorry, lineHeight of system font not supported on JSB.
JS: == 启动界面载入 (首个页面) ==
2018-01-18 18:47:29.244306 GAME-mobile[260:17017] ========CFBundleIdentifier================com.shell.xbsh
JS: --M-a-i-n–S-t-a-r-t–
JS: os: iOS
JS: language: zh
JS: browser: null
JS: isMobile: true
JS: isNative: true
JS: isBrowser: undefined
JS: searchPaths(1st time is null): null
JS: —I----N----F----O—
libpng warning: Interlace handling should be turned on when using png_read_image
libpng warning: iCCP: known incorrect sRGB profile
JS: – set decimal config –
JS: – set decimal config done –
JS: Activate: 562.438ms
In the constructor of HttpClient!
2018-01-18 18:47:29.798162 GAME-mobile[260:17316] Starting to load http://cdn..com/common.json
2018-01-18 18:47:29.798387 GAME-mobile[260:17317] Starting to load http://cdn.
.com/com.shell.xbsh.json
Error compiling builtin: Invalid private name ‘@createResolvingFunctions
2018-01-18 18:47:31.741917 GAME-mobile[260:17316] Received response from request to url http://cdn..com/common.json
2018-01-18 18:47:31.752867 GAME-mobile[260:17317] Received response from request to url http://cdn.
.com/com.shell.xbsh.json
XMLHttpRequest_finalize, 0x101c02000 …
XMLHttpRequest_finalize, 0x101a093d0 …

这个问题好像不是网络问题,而是在Promise里面调用resolve的时候报错了

猜的情况,估计是Promise.all,请求网络数据,返回来的上下文变化了,无法resolve吧~

找到一样的问题了, 官方啥时候解决下,目前暂时用bluebird代替了promise,希望能早日解决:yum:
http://forum.cocos.com/t/ios-http/54465

你们用的是 JavaScriptCore 内置的 Promise?是什么版本的 iOS 才会这样?

就是引擎原本的Promise,没有做任何改动的,然后出问题的手机是10.0.2的6s

这个是?

能赐个demo么?
Promise 是JavaScriptCore 自带的,应该不至于有问题吧。

https://stackoverflow.com/questions/40367747/error-compiling-builtin-while-executing-javascript-code-in-javascriptcore

This is a bug in the JavascriptCore’s Promise implementation. I opened a ticket at Apple and it is confirmed.

An workaround is to come with your own Promise implementation.