Animation.csd: No such file or directory / ant/build.xml:888: The following error occurred while executing this line:

Hi, when I try to build cpp-tests for Android with command line (python android-build.py cpp-tests) I get this error:

Building apk...
Traceback (most recent call last):
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/bin/cocos.py", line 998, in <module>
    run_plugin(command, argv, plugins)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/bin/cocos.py", line 916, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/project_compile.py", line 1546, in run
    self.build_android()
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/project_compile.py", line 527, in build_android
    self.apk_path = builder.do_build_apk(build_mode, self._no_apk, output_dir, self._custom_step_args, self)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/build_android.py", line 435, in do_build_apk
    self._copy_resources(custom_step_args, assets_dir)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/build_android.py", line 527, in _copy_resources
    shutil.rmtree(assets_dir)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 2] No such file or directory: '/Volumes/Documentos/Software/cocos2d-x-3.13.1/tests/cpp-tests/proj.android/assets/ActionTimeline/._Animation.csd'
Build dynamic library for project [ /Volumes/Documentos/Software/cocos2d-x-3.13.1/build/../tests/cpp-tests ] fails!

What am I doing wrong? Thanks for the help!

That is a Cocos Studio file. It should be working.

Did you get v3.13.1 from our website as a .zip or from GitHub?

Yes! It comes from the site…

The first time I only copied and pasted the sdk folder from Android Studio. Now I downloaded the android-sdk-macosxandroid-sdk-macosx and get a very similar error:

Building apk...
Traceback (most recent call last):
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/bin/cocos.py", line 998, in <module>
    run_plugin(command, argv, plugins)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/bin/cocos.py", line 916, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/project_compile.py", line 1546, in run
    self.build_android()
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/project_compile.py", line 527, in build_android
    self.apk_path = builder.do_build_apk(build_mode, self._no_apk, output_dir, self._custom_step_args, self)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/build_android.py", line 435, in do_build_apk
    self._copy_resources(custom_step_args, assets_dir)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/build_android.py", line 527, in _copy_resources
    shutil.rmtree(assets_dir)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 2] No such file or directory: '/Volumes/Documentos/Software/cocos2d-x-3.13.1/tests/cpp-tests/proj.android/assets/ActionTimeline/Default/._Button_Disable.png'
Build dynamic library for project [ /Volumes/Documentos/Software/cocos2d-x-3.13.1/build/../tests/cpp-tests ] fails!

I’d go through the command-line installation to make sure there isn’t a missing step. http://cocos2d-x.org/docs/installation/Android-terminal/index.html

No missing steps. This is my environment:

  • JDK: 1.7.0_79-b15
  • SDK: android-sdk_r24.4.1-macosx
  • NDK: android-ndk-r12b
  • Python: 2.7.12
  • Ant: 1.9.7

No problem with python setup.py; also using source ~/.bash_profile; then cd build/; only target 13 from android list target and finally python android-build.py cpp-tests.

If I use python android-build.py -p 13 cpp-tests I get a similar error:

Building apk...
Traceback (most recent call last):
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/bin/cocos.py", line 998, in <module>
    run_plugin(command, argv, plugins)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/bin/cocos.py", line 916, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/project_compile.py", line 1546, in run
    self.build_android()
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/project_compile.py", line 527, in build_android
    self.apk_path = builder.do_build_apk(build_mode, self._no_apk, output_dir, self._custom_step_args, self)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/build_android.py", line 435, in do_build_apk
    self._copy_resources(custom_step_args, assets_dir)
  File "/Volumes/Documentos/Software/cocos2d-x-3.13.1/tools/cocos2d-console/plugins/plugin_compile/build_android.py", line 527, in _copy_resources
    shutil.rmtree(assets_dir)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 2] No such file or directory: '/Volumes/Documentos/Software/cocos2d-x-3.13.1/tests/cpp-tests/proj.android/assets/ActionTimeline/._Default'
Build dynamic library for project [ /Volumes/Documentos/Software/cocos2d-x-3.13.1/build/../tests/cpp-tests ] fails!

Everything always points to some missing file in /Volumes/Documentos/Software/cocos2d-x-3.13.1/tests/cpp-tests/proj.android/assets/ActionTimeline/.

I’ll try these steps as well

Look, I downloaded the cocosc2d-x again from the site, and I’m getting this error:

BUILD FAILED
/Users/NZ/Documents/Android/android-sdk-macosx/tools/ant/build.xml:888: The following error occurred while executing this line:
/Users/NZ/Documents/Android/android-sdk-macosx/tools/ant/build.xml:890: The following error occurred while executing this line:
/Users/NZ/Documents/Android/android-sdk-macosx/tools/ant/build.xml:902: The following error occurred while executing this line:
/Users/NZ/Documents/Android/android-sdk-macosx/tools/ant/build.xml:283: null returned: 1

Total time: 7 seconds
Error running command, return code: 1.
Build dynamic library for project [ /Users/NZ/Documents/Cocos2d-x/cocos2d-x-3.13.1/build/../tests/cpp-tests ] fails!

@zhangxm do you see anything?

No, i don’t met it. All cocos studio test cases are removed. And android-build.py is already deleted, are you sure you are downloading v3.13.1? Do you have another old engine installed in your machine and haven’t run setup.py to use new engine version?

Finally!

BUILD SUCCESSFUL
Total time: 47 seconds
Move apk to /Users/NZ/Documents/Cocos2d-x/cocos2d-x-3.13.1/tests/cpp-tests/bin/debug/android
Build succeed.

The problem was the JDK version.

I had the 1.7.0_791.7.0_79, I upgraded to 1.8.0_1021.8.0_102 and that solved the issue.

Thanks @slackmoehrle and @zhangxm!