从 1.4.2 升级到 1.5,有升级失败的同学来此帖报告吧

1.4.0升级1.5.0

TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.extname (path.js:1433:5)
at getBabelSourceMaps (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/editor/page/refine-sourcemap.js:1:935)
at refineSourceMap (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/editor/page/refine-sourcemap.js:1:2196)
at Stream. (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/editor/page/refine-sourcemap.js:1:2398)
at Stream.stream.write (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/node_modules/through/index.js:26:11)
at write (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/node_modules/vinyl-buffer/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/node_modules/vinyl-buffer/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/node_modules/vinyl-buffer/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:86:13)
at /Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/editor/core/compiler.js:1:1022
at /Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/editor/core/compiler.js:1:466
at BrowserWindow. (/Applications/CocosCreator 1.5.0.app/Contents/Resources/app.asar/editor/core/compiler.js:1:2045)
at BrowserWindow.g (events.js:286:16)
at emitOne (events.js:101:20)
at BrowserWindow.emit (events.js:188:7)

CCNode.js:1645 Uncaught TypeError: Cannot read property ‘setScale’ of null
CCNode.js:623 Uncaught TypeError: Cannot read property ‘setOpacity’ of null
5CCNode.js:1645 Uncaught TypeError: Cannot read property ‘setScale’ of null
CCNode.js:623 Uncaught TypeError: Cannot read property ‘setOpacity’ of null
6CCNode.js:1645 Uncaught TypeError: Cannot read property ‘setScale’ of null
CCNode.js:623 Uncaught TypeError: Cannot read property ‘setOpacity’ of null

进入有tilemap的场景,就报错

let ff = [];
for(let k in ff){
cc.log(k);
}
这个循环居然能进去 会打印qsort 麻烦修复下

数组不能用for in 哦。

1.3.3升级到1.5.5android原生平台找不到ndk,

版本回退1.3.3之后还是没办法再原生平台运行 ,一运行就报错 ,闪退,工程不较大,找问题要话好多时间
05-25 13:09:37.160: F/libc(4531): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x20 in tid 4531 (GLThread 1511)

05-25 13:09:37.890: W/AudioTrack(4681): releaseBuffer() track 0xac769fc0 disabled due to previous underrun, restarting

找不到 ndk 的问题,可以试试:

Right click your project in Android Studio, choose “Open Module Settings”

In the popup dialog, select the “SDK Location” tab and fill in the missing “Android NDK location”

js 数组是可以用for in的 1.4 还是没问题的 1.5 就不行了

使用 for in 本来就是一个不好的用法,1.5 里面 box2d 有污染名字空间。

这是由于自动生成的碰撞体轮廓不合法导致的,由于我们使用第三方库来生成碰撞体,暂时没法避免这个崩溃,会在之后版本中想办法解决。

目前只要把 threshold 属性设成较大的数值就可以避免这种锯齿状的轮廓,下图是同样位置的轮廓线,threshold 改成 2 以后就可以运行了,而且这样比较简单的形状也比较节省机能

至于画面变绿是因为你开启了 debug draw,碰撞体会显示绿色。

这个问题可能是由空脚本文件导致的,可以检查一下项目里是否有这类脚本

1.4.2 升级 1.5.0 后编译Android 黑屏

这问题提了这英文 forum

http://discuss.cocos2d-x.org/t/webgl-error-bindtexture-attempt-to-bind-a-deleted-texture/35948

正是用了这个方法编译之后 版本回退也不行了 不知道什么原因

new cc.Sequence 这个1.5.4 有问题吗 这个在android 原生平台有遇到闪退

这问题偶尔才会出现, 没法做 test case 给你。
可是我帮你们分析了这问题。

问题处在 schedule 里,instanceId 用 getTargetId 拿到 undefined。

这 undefined 的 instanceId 用来领取 hashForTimers 里的 element。

默认用 undefined 来领取 hashForTimers 里的 element 为空,可是 hashForTimers 里 undefined 有了其他 element。

就因为这样 element 拿错了,接下来的 if (!element) 会跑到 cc.assert 。这莫名其妙的 element 的 paused 是 undefined, cc.assert 会失败。

1赞

无法引入第三方underscore.js

TypeError: Cannot read property ‘_’ of undefined
at file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:26048:32
at Object.require.underscore (assets/Src/Common/underscore.js:1416:1)
at s (file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:1:262)
at file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:1:313
at Object.require.log.Environment (assets/Src/Common/log.js:1)
at s (file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:1:262)
at file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:1:313
at Object.require.AudioManager.log (assets/Src/Common/AudioManager.js:1)
at s (file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:1:262)
at e (file:///Users/yanan/Desktop/818Client/library/bundle.project.js?001:1:433)

这个不能导入 underscore 不是 1.5 才有的问题吧?

安卓编译之后再AS打开编译报错,使用的模板是link,default模板编译不通过(报这个错:arm-linux-androideabi-g++: error: F:tutorial-blackjack-masterbuildjsb-defaultframeworkscocos2d-xexternal/android/armeabi-v7a/libjs_static.a: No such file or directory)
AS上面的日志
D:\software\CocosCreator1.5\resources\cocos2d-x\cocos\platform\CCPlatformConfig.h
Error:(143, 6) error: #error “Cannot recognize the target platform; are you targeting an unsupported platform?”

F:\tutorial-blackjack-master\build\jsb-link\frameworks\runtime-src\Classes\AppDelegate.h
Error:(18, 30) error: ‘cocos2d’ has not been declared
Error:(18, 39) error: expected ‘{’ before ‘Application’
Error:(19, 1) error: invalid type in declaration before ‘{’ token
Error:(20, 1) error: expected primary-expression before ‘public’
Error:(20, 1) error: expected ‘}’ before ‘public’
Error:(20, 1) error: expected ‘,’ or ‘;’ before ‘public’
Error:(22, 26) error: declaration of ‘~AppDelegate’ as non-member
Error:(24, 31) error: virt-specifiers in ‘initGLContextAttrs’ not allowed outside a class definition
Error:(31, 48) error: ‘virtual’ outside class declaration
Error:(37, 48) error: ‘virtual’ outside class declaration
Error:(43, 49) error: ‘virtual’ outside class declaration
Error:(44, 1) error: expected declaration before ‘}’ token
Error:(18, 30) error: ‘cocos2d’ has not been declared
Error:(18, 39) error: expected ‘{’ before ‘Application’
Error:(19, 1) error: invalid type in declaration before ‘{’ token
Error:(20, 1) error: expected primary-expression before ‘public’
Error:(20, 1) error: expected ‘}’ before ‘public’
Error:(20, 1) error: expected ‘,’ or ‘;’ before ‘public’
Error:(22, 26) error: declaration of ‘~AppDelegate’ as non-member
Error:(24, 31) error: virt-specifiers in ‘initGLContextAttrs’ not allowed outside a class definition
Error:(31, 48) error: ‘virtual’ outside class declaration
Error:(37, 48) error: ‘virtual’ outside class declaration
Error:(43, 49) error: ‘virtual’ outside class declaration
Error:(44, 1) error: expected declaration before ‘}’ token
Error:(18, 30) error: ‘cocos2d’ has not been declared
Error:(18, 39) error: expected ‘{’ before ‘Application’
Error:(19, 1) error: invalid type in declaration before ‘{’ token
Error:(20, 1) error: expected primary-expression before ‘public’
Error:(20, 1) error: expected ‘}’ before ‘public’
Error:(20, 1) error: expected ‘,’ or ‘;’ before ‘public’
Error:(22, 26) error: declaration of ‘~AppDelegate’ as non-member
Error:(24, 31) error: virt-specifiers in ‘initGLContextAttrs’ not allowed outside a class definition
Error:(31, 48) error: ‘virtual’ outside class declaration
Error:(37, 48) error: ‘virtual’ outside class declaration
Error:(43, 49) error: ‘virtual’ outside class declaration
Error:(44, 1) error: expected declaration before ‘}’ token
Error:(18, 30) error: ‘cocos2d’ has not been declared
Error:(18, 39) error: expected ‘{’ before ‘Application’
Error:(19, 1) error: invalid type in declaration before ‘{’ token
Error:(20, 1) error: expected primary-expression before ‘public’
Error:(20, 1) error: expected ‘}’ before ‘public’
Error:(20, 1) error: expected ‘,’ or ‘;’ before ‘public’
Error:(22, 26) error: declaration of ‘~AppDelegate’ as non-member
Error:(24, 31) error: virt-specifiers in ‘initGLContextAttrs’ not allowed outside a class definition
Error:(31, 48) error: ‘virtual’ outside class declaration
Error:(37, 48) error: ‘virtual’ outside class declaration
Error:(43, 49) error: ‘virtual’ outside class declaration
Error:(44, 1) error: expected declaration before ‘}’ token
之前1.4版本是没问题的

这个是由于项目所在路径过长导致的错误,在 Android Studio 里直接编译可以避免这个问题