Error compiling for Lua

Hello Guys,

I managed to compile the project and cpptests worked, but I’m generating the project to program on the Lua and always gives error when I try to generate the app for android.

To create the project I use

cocos new CocosLuaGame6 -p com.test6 -l lua -d. 

So far it works just fine :), but when trying to generate the project using android

cocos run -s CocosLuaGame6 - android 

Occurs the following errors:

[armeabi] StaticLibrary  : libcpufeatures.a
[armeabi] SharedLibrary  : libcocos2dlua.so
F:/Softwares/cocos/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin\ld.exe: error: F:/Softwares/cocos/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.8/libgcc.a(pr-support.o): multiple definition of '_Unwind_GetRegionStart'
F:/Softwares/cocos/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin\ld.exe: F:/Softwares/cocos/android-ndk-r10/sources/cxx-stl/llvm-libc++/libs/armeabi/thumb/libc++_static.a(Unwind-EHABI.o): previous definition here
F:/Softwares/cocos/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin\ld.exe: error: F:/Softwares/cocos/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.8/libgcc.a(pr-support.o): multiple definition of '_Unwind_GetLanguageSpecificData'
F:/Softwares/cocos/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin\ld.exe: F:/Softwares/cocos/android-ndk-r10/sources/cxx-stl/llvm-libc++/libs/armeabi/thumb/libc++_static.a(Unwind-EHABI.o): previous definition here
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make.exe: *** [obj/local/armeabi/libcocos2dlua.so] Error 1
make.exe: Leaving directory `F:/Sistemas/cocos/testes2x/CocosLuaGame5/frameworks/runtime-src/proj.android'
Running command: compile
Building mode: debug
building native
NDK build mode: release
The Selected NDK toolchain version was 4.8 !
running: 'F:\Softwares\cocos\android-ndk-r10\ndk-build -C F:\Sistemas\cocos\testes2x\CocosLuaGame5\frameworks\runtime-src\proj.android -j3 NDK_MODULE_PATH=F:\Sistemas\cocos\testes2x\CocosLuaGame5\frameworks\runtime-src\proj.android\../../cocos2d-x;F:\Sistemas\cocos\testes2x\CocosLuaGame5\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/;F:\Sistemas\cocos\testes2x\CocosLuaGame5\frameworks\runtime-src\proj.android\../../cocos2d-x/external;F:\Sistemas\cocos\testes2x\CocosLuaGame5\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos/scripting'

Error running command, return code: 2

can help?

thanks

Hi.

You are using android ndk r10. It’s not supported. http://cocos2d-x.org/news/307 Try it with ndkr9d http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86_64.zip

Hello Michael, thanks for the reply :slight_smile: I switched to the NDK 9 and it worked :slight_smile:

I compile for Android but no errors when installing the APK on the phone the screen goes black and never left it.

any ideas?

09-22 16:56:53.894: W/Surface(492): Surfaces should always be created with the HIDDEN flag set to ensure that they are not made visible prematurely before all of the surface's properties have been configured.  Set the other properties and make the surface visible within a transaction.  New surface name: FreezeSurface

09-22 16:56:53.894: W/Surface(492): 	at android.view.Surface.<init>(Surface.java:337)

09-22 16:56:53.894: W/Surface(492): 	at com.android.server.wm.ScreenRotationAnimation.<init>(ScreenRotationAnimation.java:258)