Test program crashes when try to run on android

I was trying to run test android projects provided by cocos2dx ,Every time when the app is installed onto virtual device and try to launch , It crashes. I’m new to cocos2dx and tried reading some forum posts related to this , but not getting any clue how to fix this problem.

this is the logcat output ,

    07-22 09:53:42.095: D/AndroidRuntime(1730): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
07-22 09:53:42.095: D/AndroidRuntime(1730): CheckJNI is OFF
07-22 09:53:42.099: D/dalvikvm(1730): Trying to load lib libjavacore.so 0x0
07-22 09:53:42.099: D/dalvikvm(1730): Added shared lib libjavacore.so 0x0
07-22 09:53:42.103: D/dalvikvm(1730): Trying to load lib libnativehelper.so 0x0
07-22 09:53:42.103: D/dalvikvm(1730): Added shared lib libnativehelper.so 0x0
07-22 09:53:42.143: D/AndroidRuntime(1730): Calling main entry com.android.commands.pm.Pm
07-22 09:53:42.143: D/AndroidRuntime(1730): Shutting down VM
07-22 09:53:42.143: D/dalvikvm(1730): Debugger has detached; object registry had 1 entries
07-22 09:53:42.143: I/AndroidRuntime(1730): NOTE: attach of thread 'Binder_1' failed
07-22 09:53:42.383: D/AndroidRuntime(1740): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
07-22 09:53:42.383: D/AndroidRuntime(1740): CheckJNI is OFF
07-22 09:53:42.387: D/dalvikvm(1740): Trying to load lib libjavacore.so 0x0
07-22 09:53:42.387: D/dalvikvm(1740): Added shared lib libjavacore.so 0x0
07-22 09:53:42.387: D/dalvikvm(1740): Trying to load lib libnativehelper.so 0x0
07-22 09:53:42.391: D/dalvikvm(1740): Added shared lib libnativehelper.so 0x0
07-22 09:53:42.403: E/cutils-trace(1740): Error opening trace file: No such file or directory (2)
07-22 09:53:42.427: D/AndroidRuntime(1740): Calling main entry com.android.commands.am.Am
07-22 09:53:42.427: D/dalvikvm(1740): Note: class Landroid/app/ActivityManagerNative; has 163 unimplemented (abstract) methods
07-22 09:53:42.431: I/ActivityManager(479): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.cocos2dx.cpp_tests/.AppActivity} from pid 1740
07-22 09:53:42.539: D/AndroidRuntime(1740): Shutting down VM
07-22 09:53:42.539: D/jdwp(1740): Got wake-up signal, bailing out of select
07-22 09:53:42.539: D/dalvikvm(1740): Debugger has detached; object registry had 1 entries
07-22 09:53:42.539: D/dalvikvm(1751): Late-enabling CheckJNI
07-22 09:53:42.547: I/dalvikvm(1751): Turning on JNI app bug workarounds for target SDK version 9...
07-22 09:53:42.547: I/ActivityManager(479): Start proc org.cocos2dx.cpp_tests for activity org.cocos2dx.cpp_tests/.AppActivity: pid=1751 uid=10049 gids={50049, 3003, 1028}
07-22 09:53:42.555: E/jdwp(1751): Failed sending reply to debugger: Broken pipe
07-22 09:53:42.555: D/dalvikvm(1751): Debugger has detached; object registry had 1 entries
07-22 09:53:42.603: D/SurfaceFlinger(463): setOrientation, mFbdev=0xb8671378, mFbDev->setOrientation=0xb671bcc0, orientation=1
07-22 09:53:42.603: I/gralloc_vbox86(463): setOrientation: orientation=1
07-22 09:53:42.607: I/ActivityManager(479): Config changes=1480 {1.0 ?mcc?mnc en_US ldltr sw384dp w598dp h359dp 320dpi nrml land finger qwerty/v/v dpad/v s.19}
07-22 09:53:42.695: I/InputReader(479): Reconfiguring input devices.  changes=0x00000004
07-22 09:53:42.695: I/InputReader(479): Device reconfigured: id=1, name='androVM Virtual Input', size 768x1280, orientation 1, mode 1, display id 0
07-22 09:53:42.695: I/InputReader(479): Device reconfigured: id=2, name='androVM via VirtualBox seamless mouse', size 768x1280, orientation 0, mode 4, display id 0
07-22 09:53:42.695: I/InputReader(479): Reconfiguring input devices.  changes=0x00000004
07-22 09:53:42.695: I/InputReader(479): Device reconfigured: id=1, name='androVM Virtual Input', size 768x1280, orientation 1, mode 1, display id 0
07-22 09:53:42.695: I/InputReader(479): Device reconfigured: id=2, name='androVM via VirtualBox seamless mouse', size 768x1280, orientation 0, mode 4, display id 0
07-22 09:53:42.703: D/dalvikvm(682): GC_FOR_ALLOC freed 13457K, 63% free 7439K/19660K, paused 9ms, total 11ms
07-22 09:53:42.731: I/dalvikvm-heap(682): Grow heap (frag case) to 13.548MB for 6410572-byte allocation
07-22 09:53:42.735: D/dalvikvm(682): GC_FOR_ALLOC freed 839K, 35% free 12860K/19660K, paused 9ms, total 9ms
07-22 09:53:42.743: D/AndroidRuntime(1751): Shutting down VM
07-22 09:53:42.747: W/dalvikvm(1751): threadid=1: thread exiting with uncaught exception (group=0xa4bcc648)
07-22 09:53:42.747: E/AndroidRuntime(1751): FATAL EXCEPTION: main
07-22 09:53:42.747: E/AndroidRuntime(1751): java.lang.UnsatisfiedLinkError: Couldn't load cpp_tests from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.cocos2dx.cpp_tests-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.cocos2dx.cpp_tests-1, /system/lib]]]: findLibrary returned null
07-22 09:53:42.747: E/AndroidRuntime(1751):     at java.lang.Runtime.loadLibrary(Runtime.java:355)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at java.lang.System.loadLibrary(System.java:525)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:66)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:80)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.Activity.performCreate(Activity.java:5133)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.os.Looper.loop(Looper.java:137)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at android.app.ActivityThread.main(ActivityThread.java:5103)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at java.lang.reflect.Method.invokeNative(Native Method)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at java.lang.reflect.Method.invoke(Method.java:525)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-22 09:53:42.747: E/AndroidRuntime(1751):     at dalvik.system.NativeStart.main(Native Method)
07-22 09:53:42.755: W/ActivityManager(479):   Force finishing activity org.cocos2dx.cpp_tests/.AppActivity
07-22 09:53:42.775: D/dalvikvm(682): GC_FOR_ALLOC freed 1K, 35% free 12860K/19660K, paused 3ms, total 3ms
07-22 09:53:42.779: I/dalvikvm-heap(682): Grow heap (frag case) to 19.282MB for 6869836-byte allocation
07-22 09:53:42.779: D/dalvikvm(682): GC_FOR_ALLOC freed 0K, 26% free 19569K/26372K, paused 2ms, total 2ms
07-22 09:53:42.787: D/SurfaceFlinger(463): setOrientation, mFbdev=0xb8671378, mFbDev->setOrientation=0xb671bcc0, orientation=0
07-22 09:53:42.787: I/gralloc_vbox86(463): setOrientation: orientation=0
07-22 09:53:42.867: D/dalvikvm(479): GC_FOR_ALLOC freed 1319K, 40% free 8995K/14812K, paused 8ms, total 9ms
07-22 09:53:42.867: I/dalvikvm-heap(479): Grow heap (frag case) to 10.039MB for 1127532-byte allocation
07-22 09:53:42.883: D/dalvikvm(479): GC_FOR_ALLOC freed 23K, 37% free 10073K/15916K, paused 13ms, total 13ms
07-22 09:53:42.891: D/dalvikvm(682): GC_FOR_ALLOC freed 12970K, 67% free 6600K/19660K, paused 4ms, total 4ms
07-22 09:53:42.891: I/dalvikvm-heap(682): Grow heap (frag case) to 12.730MB for 6410572-byte allocation
07-22 09:53:42.895: I/ActivityManager(479): Config changes=1480 {1.0 ?mcc?mnc en_US ldltr sw384dp w384dp h567dp 320dpi nrml port finger qwerty/v/v dpad/v s.20}
07-22 09:53:42.899: D/dalvikvm(682): GC_FOR_ALLOC freed <1K, 35% free 12860K/19660K, paused 3ms, total 3ms
07-22 09:53:42.911: I/InputReader(479): Reconfiguring input devices.  changes=0x00000004
07-22 09:53:42.911: I/InputReader(479): Device reconfigured: id=1, name='androVM Virtual Input', size 768x1280, orientation 0, mode 1, display id 0
07-22 09:53:42.911: I/InputReader(479): Device reconfigured: id=2, name='androVM via VirtualBox seamless mouse', size 768x1280, orientation 0, mode 4, display id 0
07-22 09:53:42.911: I/InputReader(479): Reconfiguring input devices.  changes=0x00000004
07-22 09:53:42.911: I/InputReader(479): Device reconfigured: id=1, name='androVM Virtual Input', size 768x1280, orientation 0, mode 1, display id 0
07-22 09:53:42.911: I/InputReader(479): Device reconfigured: id=2, name='androVM via VirtualBox seamless mouse', size 768x1280, orientation 0, mode 4, display id 0
07-22 09:53:42.951: D/dalvikvm(682): GC_FOR_ALLOC freed 1K, 35% free 12862K/19660K, paused 2ms, total 2ms
07-22 09:53:42.959: I/dalvikvm-heap(682): Grow heap (frag case) to 19.284MB for 6869836-byte allocation
07-22 09:53:42.963: D/dalvikvm(682): GC_FOR_ALLOC freed 0K, 26% free 19571K/26372K, paused 2ms, total 2ms
07-22 09:53:43.023: D/PhoneStatusBar(682): mSettingsPanelGravity = 55
07-22 09:53:43.039: D/PhoneStatusBar(682): mSettingsPanelGravity = 55
07-22 09:53:43.071: I/WindowManager(479): Screen frozen for +518ms due to Window{528ae7ac u0 NavigationBar}
07-22 09:53:43.359: W/ActivityManager(479): Activity pause timeout for ActivityRecord{528bb5f8 u0 org.cocos2dx.cpp_tests/.AppActivity}
07-22 09:53:43.383: W/EGL_genymotion(907): eglSurfaceAttrib not implemented
07-22 09:53:45.099: D/dalvikvm(479): GC_EXPLICIT freed 114K, 36% free 10194K/15916K, paused 1ms+1ms, total 14ms
07-22 09:53:53.419: I/Process(1751): Sending signal. PID: 1751 SIG: 9
07-22 09:53:53.427: I/ActivityManager(479): Process org.cocos2dx.cpp_tests (pid 1751) has died.
07-22 09:53:53.459: W/InputMethodManagerService(479): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@52b6b4e4 attribute=null, token = android.os.BinderProxy@52767a74
07-22 09:55:58.739: D/dalvikvm(776): GC_FOR_ALLOC freed 507K, 21% free 2647K/3348K, paused 7ms, total 7ms
07-22 09:59:51.323: D/dalvikvm(907): GC_FOR_ALLOC freed 1768K, 53% free 10994K/23180K, paused 10ms, total 13ms
07-22 10:01:30.039: D/dalvikvm(776): GC_FOR_ALLOC freed 511K, 22% free 2644K/3348K, paused 7ms, total 7ms

can you be more specific about your development specifications as well as a brief description about your problem.

This code gives a head ache, hardly anyone could answer you, if you would paste the console output… ha ha… :smile:

Ok, no problem.
Tell me, is this running fine on an actual device… ??

i hope you’ve got the tests apk generated correctly

or else check in the wiki except the last section where it says to use adb command and run the game into the emulator.
just make successful build and go to the bin folder of tests and there would be the .apk

Tell us your problem a bit descriptive, not this much descriptive… ha ha… :smile:

The important line is:

07-22 09:53:42.747: E/AndroidRuntime(1751): java.lang.UnsatisfiedLinkError: Couldn’t load cpp_tests from loader dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/org.cocos2dx.cpp_tests-1.apk”],nativeLibraryDirectories=[/data/app-lib/org.cocos2dx.cpp_tests-1, /system/lib]]]: findLibrary returned null

The important part of this is:

java.lang.UnsatisfiedLinkError: Couldn’t load cpp_tests from loader

This post suggests a solution: Crash when run the CppTests in Eclipse

I’m on a Linux distro (Elementary) 64bit , using ant version 1.8.2 , ndk r10, and latest update of adt bundle.

No this is not running in either acual device or virtual device.
I’ll try to install generated apk manually and will update here.

ndk r10d has some issue and having some linking error
use ndk r9d instead. :smile:

it may seem fascinating to always use the latest version for everything but it’s not good.
let the developers tackle with that issue.

But that’s fine, even i did it when i got into cocos2d-x, but it worked for me
but then this forum will teach you everything my friend. :smile:
anyways… there’s the news about the issue ndk 10d has… see here

use ndk r9d instead to solve your issues, i believe they will be resolved

Happy Coding

Having issues with building samples,

    nipun@nipun-N55SL:~/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build$ python android-build.py -p 19 cpp-tests
/home/nipun/Documents/AndroidDev/android-ndk-r10/ndk-build -j8 -C /home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../tests/cpp-tests/proj.android NDK_DEBUG=1 NDK_MODULE_PATH=/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/..:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../external:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos
Android NDK: WARNING:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos/./Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos/platform/android/Android.mk:cocos2dxandroid_static: LOCAL_LDLIBS is always ignored for static libraries    

/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos/./3d/CCBundleReader.cpp:94:23: error: 
      return type of out-of-line definition of 'cocos2d::BundleReader::tell'
      differs from that in the declaration
ssize_t BundleReader::tell()
                      ^
/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos/./3d/CCBundleReader.h:90:14: note: 
      previous declaration is here
    long int tell();
             ^
1 error generated.
make: *** [obj/local/armeabi/objs-debug/cocos2dx_static/3d/CCBundleReader.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/tests/cpp-tests/proj.android'
Build dynamic library for project [ /home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../tests/cpp-tests/proj.android ] fails!

I ditched some of the output

Cool , I’ll try with ndk r9d :smile:

@pabitrapadhy no matter which ndk verison I use , It throws same warnings and errors :frowning:

some of them are,

nipun@nipun-N55SL:~/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build$ python android-build.py -p 19 cpp-tests
/home/nipun/Documents/AndroidDev/android-ndk-r9d/ndk-build -j8 -C /home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../tests/cpp-tests/proj.android NDK_DEBUG=1 NDK_MODULE_PATH=/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/..:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../external:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos
Android NDK: WARNING:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos/./Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../cocos/platform/android/Android.mk:cocos2dxandroid_static: LOCAL_LDLIBS is always ignored for static libraries    
make: Entering directory `/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/tests/cpp-tests/proj.android'


/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp:79:47: warning: 
      missing sentinel in function call [-Wsentinel]
    Menu* pMenu = Menu::create(pMenuItem, NULL);


In file included from /home/nipun/Documents/AndroidDev/android-ndk-r9d/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:21:
In file included from /home/nipun/Documents/AndroidDev/android-ndk-r9d/sources/cxx-stl/llvm-libc++/../../android/support/include/locale.h:33:
/home/nipun/Documents/AndroidDev/android-ndk-r9d/platforms/android-9/arch-arm/usr/include/locale.h:55:1: warning: 
      empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]
struct lconv { };
^
1 warning generated.
make: Leaving directory `/home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/tests/cpp-tests/proj.android'
Build dynamic library for project [ /home/nipun/Downloads/cocos2d-x-3.2_2/cocos2d-x-3.2/build/../tests/cpp-tests/proj.android ] fails!

ndk r10d has some issues that the engineering team is working on. What version of GCC are you working with, please see this: http://www.cocos2d-x.org/news/307

and

You need gcc-4.9

@slackmoehrle is that the toolchain showing everytine when the project is builded. ?

no that’s NDK toolchain, i guess.
then where could i find the GCC version… ??

gcc (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1

I think that you need to upgrade to gcc 4.9 per the notes I referenced above.

Found out Ubuntu 12.04 won’t allow me to update gcc to 4.9 , going to try cocos2dx 3.1 as it only needs gcc 4.7.

you might need to upgrade to gcc 4.8 for 3.1.1, I don’t recall, but recall needing to do that on a debian box to get it to work.

and can you explain why you can’t upgrade? gcc is open source, you can download it and compile it yourself…

Got 3.1 to work , but still having lot’s of warnings coming up…

In file included from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./math/CCGeometry.h:32:0,
                 from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/ccTypes.h:33,
                 from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./platform/CCGLViewProtocol.h:29,
                 from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./platform/CCGLViewProtocol.cpp:26:
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./platform/CCGLViewProtocol.cpp: In member function 'virtual void cocos2d::GLViewProtocol::handleTouchesMove(int, intptr_t*, float*, float*)':
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/CCPlatformMacros.h:219:67: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'intptr_t {aka int}' [-Wformat=]
 #define CCLOG(format, ...)      cocos2d::log(format, ##__VA_ARGS__)
                                                                   ^
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./platform/CCGLViewProtocol.cpp:318:13: note: in expansion of macro 'CCLOG'
             CCLOG("Moving touches with id: %ld error", id);



In file included from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/CCUserDefault.h:28:0,
                 from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/CCUserDefaultAndroid.cpp:25:
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/CCUserDefaultAndroid.cpp: In member function 'void cocos2d::UserDefault::setDataForKey(const char*, const cocos2d::Data&)':
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/CCPlatformMacros.h:219:67: warning: format '%d' expects argument of type 'int', but argument 3 has type 'ssize_t {aka long int}' [-Wformat=]
 #define CCLOG(format, ...)      cocos2d::log(format, ##__VA_ARGS__)
                                                                   ^
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/./base/CCUserDefaultAndroid.cpp:458:5: note: in expansion of macro 'CCLOG'
     CCLOG("SET DATA FOR KEY: --%s--%d", value.getBytes(), value.getSize());

In file included from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../cocos2d.h:113:0,
                 from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/ccdandroidUtils.cpp:26:
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelTTF.h:77:77: warning: 'LabelTTF' is deprecated (declared at /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelTTF.h:59) [-Wdeprecated-declarations]
                              TextVAlignment vAlignment = TextVAlignment::TOP);
                                                                             ^
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelTTF.h:81:105: warning: 'LabelTTF' is deprecated (declared at /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelTTF.h:59) [-Wdeprecated-declarations]
     static LabelTTF * createWithFontDefinition(const std::string& string, FontDefinition &textDefinition);
                                                                                                         ^
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelTTF.h:116:30: warning: 'LabelTTF' is deprecated (declared at /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelTTF.h:59) [-Wdeprecated-declarations]
     static LabelTTF * create();
                              ^
[armeabi] Compile++ thumb: box2d_static <= b2ChainAndCircleContact.cpp
In file included from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../cocos2d.h:114:0,
                 from /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/ccdandroidUtils.cpp:26:
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelBMFont.h:88:186: warning: 'LabelBMFont' is deprecated (declared at /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelBMFont.h:74) [-Wdeprecated-declarations]
     static LabelBMFont * create(const std::string& str, const std::string& fntFile, float width = 0, TextHAlignment alignment = TextHAlignment::LEFT,const Vec2& imageOffset = Vec2::ZERO);
                                                                                                                                                                                          ^
/home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelBMFont.h:92:33: warning: 'LabelBMFont' is deprecated (declared at /home/nipun/Documents/AndroidDev/cocos2d-x-3.1.1/build/../cocos/audio/android/../../2d/CCLabelBMFont.h:74) [-Wdeprecated-declarations]
     static LabelBMFont * create();
                                 ^

you still think it’s the gcc which give those warnings ?

As I found out gcc-4.9 build only for Ubuntu 14.04 , I’m still not familier with building packages from source code.Still on learning phase. :smile:

If you know how to build gcc-4.9 for Ubuntu 12.04 ,please could you guide me with that.

Gosh. I know how to build gcc for os x, but not for linux.

Cool then I’ll wait for Ubuntu 14.04 , 3.1 is working with gcc 4.8 with some warnings though