2

After importing an cocos2d project to eclipse, it raise two weird errors:

"Android Library Update" , "C/C++ Indexer"

Error:

   An internal error occured during :"C/C++" . java.lang.NullPointerException.               
    An internal error occured during :"Android Library Update" . java.lang.NullPointerException.

Thanks in advance.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Nya
  • 310
  • 2
  • 10
  • please make sure you have gone through this: http://www.cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Android and http://www.cocos2d-x.org/wiki/How_to_Build_an_Android_Project_with_Eclipse – GameDeveloper Aug 19 '14 at 15:35
  • I have done all these things – Nya Aug 20 '14 at 05:26

2 Answers2

8

See my answer https://stackoverflow.com/a/25892787/77156

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.

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.

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>
Community
  • 1
  • 1
Diaa Sami
  • 3,249
  • 24
  • 31
0

I have this problem also, just check your project.properties file

It came out that I missed this line ..

android.library.reference.1=../cocos2d/cocos/platform/android/java

Deflinhec
  • 65
  • 7