新建的游戏导入Eclipse能正常运行,配置什么的都弄好了,游戏运行无任何问题!
问题是:关闭Eclipse后,重新打开,就会出现
An internal error occurred during: "Android Library Update".
java.lang.NullPointerException
在Eclipse也打不开c++文件,显示Editor could not be initialized.
Details:
java.lang.NullPointerException
at org.eclipse.cdt.internal.core.settings.model.CConfigurationDescriptionCache.loadData(CConfigurationDescriptionCache.java:104)
at org.eclipse.cdt.internal.core.settings.model.CProjectDescription.loadDatas(CProjectDescription.java:196)
点project->properties->c/c++ Build也会出现
An error has occurred. See error log for more details.
java.lang.NullPointerException
但是第一次新建的项目导入运行正常,关闭再打开Eclipse问题又出现了
解决方式:
在proj.android的同级目录下,找到.cproject文件,打开后,找到如下的节点,删除之,重新打开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>
(参考:http://*.com/questions/25462415/cocos2d-x-android-set-up-error-java-lang-nullpointerexception)
=========================================
当时,还遇到了另外一个问题,自己新建了一个c++工程,从磁盘上删除了工程引用的armeabi-v7a,结果打开eclipse时出现错误:
armeabi-v7a/devices.xml 发现了以元素‘d:skin’开头的无效内容,此处不应包含子元素 ,,,,,
解决:
把自己下载的Android SDK目录中对应版本的SDK中的devices.xml这个文件删除,再把sdk里面tools\lib下的这个文件拷贝到你删除的那个文件夹里,重启eclipse;