cocos2d-x android设置错误 - java.lang.NullPointerException [英] cocos2d-x android set up error - java.lang.NullPointerException
问题描述
我正在尝试为android 设置cocos2d-x,而我按照视频教程
I'm trying to set up cocos2d-x for android and I followed a video tutorial
我通过终端的步骤没有任何问题(设置。
I passed the steps for terminal without any problem (setup.py
command result is as expected).
我的问题是在我设置 NDK_ROOT
后,在 C / C ++ Build - 环境部分中,我得到一些 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 ++ Build - 环境部分我得到 当前显示的页面包含无效值。
错误,我无法编辑环境值。
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
- android-ndk-r9d
- apache-ant-1.9.4
- cocos2d-x -3.2
- adt-bundle-mac-x86_64-20140702
- Mac OS 10.9.4
- android-ndk-r9d
- apache-ant-1.9.4
- cocos2d-x-3.2
- adt-bundle-mac-x86_64-20140702
推荐答案
我一直在尝试解决这个问题一段时间,我建议将项目中的 .cproject
文件与 templates / cpp-template-default
并删除文件中的其他部分。
我不得不删除一个部分,我不是为什么它被添加,但它现在工作。
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>
这篇关于cocos2d-x android设置错误 - java.lang.NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!