ANDROID NDK : Build Fails : multiple target patterns. Stop.


#1

I know it’s been asked lot of times, I have tried almost all the forum answers, checked stackoverflow answers,

@Admin : Please move this questions, If you feel it doesn’t belong here, I am brand new to cocos2D

Things I tried,

i. Deleting Libs and Objs
ii. Checking NDK_MODULE_PATH for spaces

Platform Details:
NDK : android-ndk-r9c
Cocos: Cocos2d-x

Here are my Logs


17:01:11 **** Build of configuration Default for project AstroSpaceWar ****
bash F:/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/gameswithcocos/AstroSpaceWar/build_native.sh
NDK_ROOT = /cygdrive/f/Android_NDK/android-ndk-r9c-windows-x86_64/android-ndk-r9c
COCOS2DX_ROOT = /cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2
APP_ROOT = /cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/gameswithcocos/AstroSpaceWar/…
APP_ANDROID_ROOT = /cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/gameswithcocos/AstroSpaceWar
Using prebuilt externals

  • /cygdrive/f/Android_NDK/android-ndk-r9c-windows-x86_64/android-ndk-r9c/ndk-build -C /cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/gameswithcocos/AstroSpaceWar NDK_MODULE_PATH=/cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2:/cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/platform/third_party/android/prebuilt
    make: Entering directory '/cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/gameswithcocos/AstroSpaceWar’
    Android NDK: WARNING:/cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
    [armeabi] Cygwin : Generating dependency file converter script
    [armeabi] Compile++ thumb: hellocpp_shared <= main.cpp
    [armeabi] Compile++ thumb: hellocpp_shared <= AppDelegate.cpp
    [armeabi] Compile++ thumb: hellocpp_shared <= HelloWorldScene.cpp
    [armeabi] Compile++ thumb: hellocpp_shared <= CCParallaxNodeExtras.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCConfiguration.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCScheduler.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCCamera.cpp
    [armeabi] Compile thumb : cocos2dx_static <= ccFPSImages.c
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAction.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionCamera.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionCatmullRom.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionEase.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionGrid.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionGrid3D.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionInstant.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionInterval.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionManager.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionPageTurn3D.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionProgressTimer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionTiledGrid.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCActionTween.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAtlasNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAffineTransform.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCGeometry.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAutoreleasePool.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCDictionary.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCNS.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCObject.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCSet.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCString.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCZone.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCArray.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCDataVisitor.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= cocos2d.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCDirector.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCDrawingPrimitives.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCDrawNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCGrabber.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCGrid.cpp
    [armeabi] Compile thumb : cocos2dx_static <= aabb.c
    [armeabi] Compile thumb : cocos2dx_static <= mat3.c
    [armeabi] Compile thumb : cocos2dx_static <= mat4.c
    [armeabi] Compile thumb : cocos2dx_static <= neon_matrix_impl.c
    [armeabi] Compile thumb : cocos2dx_static <= plane.c
    [armeabi] Compile thumb : cocos2dx_static <= quaternion.c
    F:/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/kazmath/src/quaternion.c: In function ‘kmQuaternionAssign’:
    F:/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/kazmath/src/quaternion.c:478:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    [armeabi] Compile thumb : cocos2dx_static <= ray2.c
    [armeabi] Compile thumb : cocos2dx_static <= utility.c
    [armeabi] Compile thumb : cocos2dx_static <= vec2.c
    [armeabi] Compile thumb : cocos2dx_static <= vec3.c
    [armeabi] Compile thumb : cocos2dx_static <= vec4.c
    F:/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/kazmath/src/vec4.c: In function ‘kmVec4Assign’:
    F:/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/kazmath/src/vec4.c:150:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    [armeabi] Compile thumb : cocos2dx_static <= mat4stack.c
    [armeabi] Compile thumb : cocos2dx_static <= matrix.c
    [armeabi] Compile++ thumb: cocos2dx_static <= CCKeypadDelegate.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCKeypadDispatcher.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCLabelAtlas.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCLabelBMFont.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCLabelTTF.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCLayer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCScene.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTransitionPageTurn.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTransition.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTransitionProgress.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCMenu.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCMenuItem.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCClippingNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCMotionStreak.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCProgressTimer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCRenderTexture.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCParticleExamples.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCParticleSystem.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCParticleBatchNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCParticleSystemQuad.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCImageCommonWebp.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCSAXParser.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCThread.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCFileUtils.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= platform.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCEGLViewProtocol.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCDevice.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCEGLView.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAccelerometer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCApplication.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCCommon.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCFileUtilsAndroid.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCImage.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= JniHelper.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= IMEJni.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= TouchesJni.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= DPIJni.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCScriptSupport.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ccShaders.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCGLProgram.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ccGLStateCache.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCShaderCache.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAnimation.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCAnimationCache.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCSprite.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCSpriteBatchNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCSpriteFrame.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCSpriteFrameCache.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ccUTF8.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCNotificationCenter.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCProfiling.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCPointExtension.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= TransformUtils.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCUserDefaultAndroid.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= base64.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ccUtils.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCVertex.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ccCArray.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= TGAlib.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= tinyxml2.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ZipUtils.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= ioapi.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= unzip.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCComponent.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCComponentContainer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCIMEDispatcher.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTextFieldTTF.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTexture2D.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTextureAtlas.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTextureCache.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTextureETC.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTexturePVR.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCParallaxNode.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTMXLayer.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTMXObjectGroup.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTMXTiledMap.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTMXXMLParser.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTileMapAtlas.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTouchDispatcher.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTouchHandler.cpp
    [armeabi] Compile++ thumb: cocos2dx_static <= CCTouch.cpp
    [armeabi] StaticLibrary : libcocos2d.a
    [armeabi] Compile++ thumb: cocosdenshion_static <= SimpleAudioEngine.cpp
    [armeabi] Compile++ thumb: cocosdenshion_static <= SimpleAudioEngineJni.cpp
    [armeabi] Compile++ thumb: cocosdenshion_static <= OpenSLEngine.cpp
    [armeabi] Compile++ thumb: cocosdenshion_static <= SimpleAudioEngineOpenSL.cpp
    [armeabi] StaticLibrary : libcocosdenshion.a
    [armeabi] Compile thumb : cpufeatures <= cpu-features.c
    [armeabi] StaticLibrary : libcpufeatures.a
    [armeabi] SharedLibrary : libhellocpp.so
    [armeabi] Install : libhellocpp.so => libs/armeabi/libhellocpp.so
    make: Leaving directory ‘/cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/gameswithcocos/AstroSpaceWar’

17:06:41 Build Finished (took 5m:29s.727ms)


Second Log NDK Build


Android NDK: WARNING:F:\FlappyMathSaga\cocos2d-x-2.2.2\cocos2d-x-2.2.2/cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
[armeabi] Compile++ thumb: hellocpp_shared <= main.cpp
[armeabi] Compile++ thumb: hellocpp_shared <= AppDelegate.cpp
[armeabi] Compile++ thumb: hellocpp_shared <= HelloWorldScene.cpp
[armeabi] Compile++ thumb: hellocpp_shared <= CCParallaxNodeExtras.cpp
make.exe: *** No rule to make target /cygdrive/f/FlappyMathSaga/cocos2d-x-2.2.2/cocos2d-x-2.2.2/cocos2dx/CCConfiguration.cpp', needed byobj/local/armeabi/objs/cocos2dx_static/CCConfiguration.o’. Stop.


Android.mk File


LOCAL_PATH:=$(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := hellocpp_shared

LOCAL_MODULE_FILENAME := libhellocpp

LOCAL_SRC_FILES := hellocpp/main.cpp
…/Classes/AppDelegate.cpp
…/Classes/HelloWorldScene.cpp
…/Classes/CCParallaxNodeExtras.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/Classes

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,cocos2dx)
$(call import-module,CocosDenshion/android)


Some details about - Directory Structure of the Game

AstroSpaceWar

|- jni
| -Android.mk
|-Classes


#2

Try our tutorials