写了一个helloword 在as编译还是报这个错可以解决吗?

## 使用的是as 3.0 gradle-4.0-milestone-1

G:\c\project\AnimeGame\build\jsb-default\frameworks\cocos2d-x\cocos\platform\CCPlatformConfig.h
Error:(143, 6) error: #error “Cannot recognize the target platform; are you targeting an unsupported platform?”
Error:(143, 6) error: #error “Cannot recognize the target platform; are you targeting an unsupported platform?”
Error:(143, 6) error: #error “Cannot recognize the target platform; are you targeting an unsupported platform?”
Error:(143, 6) error: #error “Cannot recognize the target platform; are you targeting an unsupported platform?”
G:\c\project\AnimeGame\build\jsb-default\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

没有人遇到这个问题吗?

有大神知道吗?或者大家都是怎么编译Android版本?:sweat_smile:

我用as 2.3.2编译也是这问题。。。。你解决了吗

我改用2.4版本 就没有报这个错了

我遇到类似的问题,看了官网文档把NDK版本换成15(14以上)就可以了