的cocos2d-X的Andr​​oid设置错误 - 显示java.lang.NullPointerException错误、oid、Andr、cocos2d

2023-09-05 04:21:15 作者:絕版い厷主ヾ

我试图建立的的cocos2d-X And​​roid版的,我跟着一个视频教程

I'm trying to set up cocos2d-x for android and I followed a video tutorial

我通过了步骤,终端没有任何问题( setup.py 命令的结果与预期一致)。

I passed the steps for terminal without any problem (setup.py command result is as expected).

我的问题是我设置之后, NDK_ROOT 在 C / C ++编译 - 环境栏目,我得到一些 显示java.lang.NullPointerException 例外。

My problem is after I set NDK_ROOT in C/C++ Build - environment section, I get some java.lang.NullPointerException exceptions.

例如,当我重新启动Eclipse我碰到下面的错误。

For example when I restart eclipse I get the following error.

An internal error occurred during: "Android Library Update".
java.lang.NullPointerException

当我试图重新打开C / C ++编译 - 环境部分,我得到的 当前显示的页面包含无效值 错误,我可以'牛逼编辑环境的价值。

When I try to reopen C/C++ Build - environment section I get The currently displayed page contains invalid values. error and I can't edit the environment values.

我查了Java构建路径,没有JRE系统库,当我尝试添加我得到同样的错误

I checked java build path, there is no JRE system library and when I try to add I get the same error

An error has occurred. See error log for more details.
java.lang.NullPointerException

我该如何解决这个问题呢?感谢您的帮助。

How can I fix the problem? Thanks for your help.

我正在

的Mac OS 10.9.4 的Andr​​oid NDK-r9d 在Apache的ANT-1.9.4 的cocos2d-X-3.2 ADT-束-MAC-x86_64-20140702

推荐答案

我一直在试图解决这一段时间,我建议比较 .cproject 在您的项目与一个在文件模板/ CPP模板默认并在文件中删除多余的部分(S)。 我不得不删除一个部分,我不知道为什么它增加了,但它的工作原理吧。

I've been trying to fix this for a while, I'd suggest comparing the .cproject file in your project with the one in templates/cpp-template-default and removing extra section(s) in your file. I had to remove one section, I don't why it was added but it works now.

更新: 看来,这部分增加,一旦你没有定义打开Eclipse与NDK_ROOT,在那之后,即使你把它定义,本节保持那里的配置文件,并会导致同样的错误,你需要删除它使你的项目工作

Update: It seems this section is added once you open eclipse with NDK_ROOT not defined, and after that, even if you define it, this section stays there in the configuration files and causes the same errors, you need to remove it to get your project to work.

本节看起来是这样,你可以在你关闭Eclipse安全地将其删除。

The section looks like this, you can remove it safely after you close eclipse.

<cconfiguration id="0.1230402123.1377291156">
            <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1230402123.1377291156" moduleId="org.eclipse.cdt.core.settings" name="Debug">
                <externalSettings/>
                <extensions>
                    <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
                    <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
                    <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
                    <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
                    <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
                    <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
                </extensions>
            </storageModule>
            <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
        </cconfiguration>