How can i use jsb.fileUtils

when i’m using jsb.fileUtils in main.js, i got this error: main.js:13:ReferenceError: jsb is not defined.
how can i call jsb functions?

jsb namespace means everything under this namespace can only be accessed under native environment:

// You should do a check before using it
if (cc.sys.isNative) {
    jsb.fileUtils;
}

i’m working on ios environment but i still cannot access jsb. any setting i need to set?

It’s very strange, what do you get from cc.log(jsb) ?

ReferenceError: jsb is not defined
it is same as before
do i need to include jsb.js?
and how to update the JSB_AUTO.cpp for cocos2d-js version 3.0?

Can you post some screen caption ? I need to know where exactly the error occurred and the original code causing the error.

cc.log(jsb) shouldn’t cause ReferenceError, if it doesn’t exist, it will print undefined in the console. So I’m sure the error occurred else where.

You don’t need to include jsb.js manually, but which platform are you compiling to?

2014-10-06 10:24:11.527 XXXXXX iOS[8295:60b] cocos2d: surface size: 1024x768
cocos2d:
{
cocos2d.x.version: 3.0-rc0
cocos2d.x.compiled_with_gl_state_cache: true
cocos2d.x.build_type: DEBUG
gl.supports_vertex_array_object: true
cocos2d.x.compiled_with_profiler: false
gl.renderer: Apple Software Renderer
gl.vendor: Apple Computer, Inc.
gl.max_texture_size: 4096
gl.max_samples_allowed: 4
gl.version: OpenGL ES 2.0 APPLE-9.4.3
gl.supports_S3TC: false
gl.supports_ATITC: false
gl.supports_ETC1: false
gl.max_texture_units: 8
gl.supports_PVRTC: true
gl.supports_NPOT: true
gl.supports_discard_framebuffer: true
gl.supports_BGRA8888: false
}

libpng warning: iCCP: known incorrect sRGB profile
cocos2d: JS: /Users/fwmp13/Library/Application Support/iPhone Simulator/7.1/Applications/F555520D-A85E-403F-8F86-F6C50B337727/XXXXXX iOS.app/main.js:17:ReferenceError: jsb is not defined

cocos2d: (evaluatedOK == JS_FALSE)

just like that
i just write cc.log(usb) in the first line of main.js and compiled to iOS platform.

i tried to re-create a new project then i can load jsb now.