Search code examples
androidc++android-ndkcocos2d-x

How to restore prebuilt files after accidentally deleting?


I ran the command:

$ git clean -fd

Removing cocos2d/cocos/platform/android/java/gen/ Removing cocos2d/cocos/platform/android/java/libs/ Removing cocos2d/cocos/platform/android/java/local.properties Removing cocos2d/cocos/platform/android/java/res/ Removing cocos2d/external/chipmunk/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/chipmunk/prebuilt/android/armeabi/ Removing cocos2d/external/chipmunk/prebuilt/android/x86/ Removing cocos2d/external/chipmunk/prebuilt/ios/ Removing cocos2d/external/chipmunk/prebuilt/linux/ Removing cocos2d/external/chipmunk/prebuilt/mac/ Removing cocos2d/external/chipmunk/prebuilt/win10/ Removing cocos2d/external/chipmunk/prebuilt/win32/ Removing cocos2d/external/chipmunk/prebuilt/winrt_8.1/ Removing cocos2d/external/chipmunk/prebuilt/wp_8.1/ Removing cocos2d/external/curl/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/curl/prebuilt/android/armeabi/ Removing cocos2d/external/curl/prebuilt/android/x86/ Removing cocos2d/external/curl/prebuilt/ios/ Removing cocos2d/external/curl/prebuilt/mac/ Removing cocos2d/external/curl/prebuilt/win32/ Removing cocos2d/external/curl/prebuilt/winrt_8.1/ Removing cocos2d/external/curl/prebuilt/wp_8.1/ Removing cocos2d/external/freetype2/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/freetype2/prebuilt/android/armeabi/ Removing cocos2d/external/freetype2/prebuilt/android/x86/ Removing cocos2d/external/freetype2/prebuilt/ios/ Removing cocos2d/external/freetype2/prebuilt/linux/ Removing cocos2d/external/freetype2/prebuilt/mac/ Removing cocos2d/external/freetype2/prebuilt/win10/ Removing cocos2d/external/freetype2/prebuilt/win32/ Removing cocos2d/external/freetype2/prebuilt/winrt_8.1/ Removing cocos2d/external/freetype2/prebuilt/wp_8.1/ Removing cocos2d/external/glfw3/prebuilt/ Removing cocos2d/external/jpeg/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/jpeg/prebuilt/android/armeabi/ Removing cocos2d/external/jpeg/prebuilt/android/x86/ Removing cocos2d/external/jpeg/prebuilt/ios/ Removing cocos2d/external/jpeg/prebuilt/linux/ Removing cocos2d/external/jpeg/prebuilt/mac/ Removing cocos2d/external/jpeg/prebuilt/win32/ Removing cocos2d/external/linux-specific/fmod/prebuilt/ Removing cocos2d/external/png/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/png/prebuilt/android/armeabi/ Removing cocos2d/external/png/prebuilt/android/x86/ Removing cocos2d/external/png/prebuilt/ios/ Removing cocos2d/external/png/prebuilt/mac/ Removing cocos2d/external/png/prebuilt/win32/ Removing cocos2d/external/sqlite3/libraries/ Removing cocos2d/external/tiff/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/tiff/prebuilt/android/armeabi/ Removing cocos2d/external/tiff/prebuilt/android/x86/ Removing cocos2d/external/tiff/prebuilt/ios/ Removing cocos2d/external/tiff/prebuilt/linux/ Removing cocos2d/external/tiff/prebuilt/mac/ Removing cocos2d/external/tiff/prebuilt/win32/ Removing cocos2d/external/webp/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/webp/prebuilt/android/armeabi/ Removing cocos2d/external/webp/prebuilt/android/x86/ Removing cocos2d/external/webp/prebuilt/ios/ Removing cocos2d/external/webp/prebuilt/linux/ Removing cocos2d/external/webp/prebuilt/mac/ Removing cocos2d/external/webp/prebuilt/win32/ Removing cocos2d/external/websockets/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/websockets/prebuilt/android/armeabi/ Removing cocos2d/external/websockets/prebuilt/android/x86/ Removing cocos2d/external/websockets/prebuilt/ios/ Removing cocos2d/external/websockets/prebuilt/linux/ Removing cocos2d/external/websockets/prebuilt/mac/ Removing cocos2d/external/websockets/prebuilt/win10/ Removing cocos2d/external/websockets/prebuilt/win32/ Removing cocos2d/external/websockets/prebuilt/winrt_8.1/ Removing cocos2d/external/websockets/prebuilt/wp_8.1/ Removing cocos2d/external/win10-specific/OggDecoder/prebuilt/ Removing cocos2d/external/win10-specific/angle/prebuilt/ Removing cocos2d/external/win10-specific/zlib/prebuilt/ Removing cocos2d/external/win32-specific/MP3Decoder/prebuilt/ Removing cocos2d/external/win32-specific/OggDecoder/prebuilt/ Removing cocos2d/external/win32-specific/OpenalSoft/prebuilt/ Removing cocos2d/external/win32-specific/gles/prebuilt/ Removing cocos2d/external/win32-specific/icon/prebuilt/ Removing cocos2d/external/win32-specific/zlib/prebuilt/ Removing cocos2d/external/winrt-specific/angle/prebuilt/ Removing cocos2d/external/winrt-specific/zlib/prebuilt/ Removing cocos2d/external/winrt_8.1-specific/OggDecoder/prebuilt/ Removing cocos2d/external/winrt_8.1-specific/angle/prebuilt/ Removing cocos2d/external/winrt_8.1-specific/zlib/prebuilt/ Removing cocos2d/external/wp_8.1-specific/OggDecoder/prebuilt/ Removing cocos2d/external/wp_8.1-specific/angle/prebuilt/ Removing cocos2d/external/wp_8.1-specific/zlib/prebuilt/ Removing cocos2d/external/zlib/prebuilt/android/armeabi-v7a/ Removing cocos2d/external/zlib/prebuilt/android/armeabi/ Removing cocos2d/external/zlib/prebuilt/android/x86/ Removing cocos2d/external/zlib/prebuilt/mac/ Removing cocos2d/plugin/plugins/qh360/proj.android/CLibs/ Removing proj.android/assets/ Removing proj.android/gen/ Removing proj.android/libs/

So now when I run:

cocos run -p android

Compilation fails with error :

Android NDK: ERROR:/Users/power/Documents/Projects/spacegame/proj.android/../cocos2d/external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /Users/power/Documents/Projects/spacegame/proj.android/../cocos2d/external/freetype2/prebuilt/android/armeabi/libfreetype.a exists or that its path is correct
make: Entering directory /Users/power/Documents/Projects/spacegame/proj.android' /Applications/android-ndk-r10c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop. make: Leaving directory/Users/power/Documents/Projects/spacegame/proj.android' Error running command, return code: 2.

How can I fix this ? I've done git clean before, but I didn't get this problem.


Solution

  • I just created a new project with cocos new, and copied the missing directories. Seems to work.