I have updated my code following the steps provided by the wiki.
1º I create a new eclipse project.
2º I run hello world and it works.
3º I put my old code on Classes, and resources.
4º I update appdelegate.cpp .h, and jni/Android.mk with new files.
5º It compile correctly.
6º Lauching from eclipse i get the following exception:
trying to load lib /data/data/org.pipero.game/lib/libgame.so
Fatal signal 11.
Something is wrong, but i don’t know what is happening.
The same code work on a xcode project.
I don’t get the CCLOG message con Appdelegate constructor, and on Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit on main.cpp neither.
In the new version, cocos2dx is linked as a static library into your project, while the old approach is a dynamic library.
Maybe I need to merge makefiles manually, but not replace it directly.
But the hello world project work normally, the log end with:
StaticLibrary : libcocosdenshion.a
SharedLibrary : libgame.so
Install : libgame.so => libs/armeabi/libgame.so
I launch the app, and work.
1º When i change the classes with mine, and edit the Android.mk —> LOCAL_SRC_FILES := Mine.cpps, it don’t work.
2º I remove the Line: jni/helloworld/main.cpp:8:29: error: HelloWorldScene.h: No such file or director, because i don’t need that.
The Library that is trying to use is the same, libgame.so.
My log in my project end with:
SharedLibrary : libgame.so
Install : libgame.so => libs/armeabi/libgame.so
The makefile is virtual the same (Except LOCAL_SRC_FILES).
but launching the SAME project, i get in logcat:
06-11 19:04:39.498: D/dalvikvm(4175): Trying to load lib /data/data/pipero.corp.new/lib/libgame.so 0x40f8ce98
06-11 19:04:39.678: A/dalvikvm(4298) : Fatal signal 11 (SIGSEGV) at 0x000000030 (code=1)
What’s going on? I have been several days without solve this problem.
So, signal 11 SEGV_MAPERR, i assume that is a problem with the compilation, the library is found, but the program cannot load it correctly. The JNI not execute jni_Onload.
I am new in cocos2dx and I am facing the same problem for last few days … If you found any solution then please help me out of this …
If I manually add the libgame.so file in that location what in error …. its error free but,
In the bulid time error occurred like this :
make: * No rule to make target `/cygdrive/d/android/cocos2d-x-master/T12/proj.android/…/…/cocos2dx/CCConfiguration.cpp’, needed by `obj/local/armeabi/objs/cocos2dx_static/CCConfiguration.o’. Stop.
I am new in cocos2dx and I am facing the same problem for last few days … If you found any solution then please help me out of this …
>
If I manually add the libgame.so file in that location what in error …. its error free but,
>
In the bulid time error occurred like this :
>
make: * No rule to make target `/cygdrive/d/android/cocos2d-x-master/T12/proj.android/…/…/cocos2dx/CCConfiguration.cpp’, needed by `obj/local/armeabi/objs/cocos2dx_static/CCConfiguration.o’. Stop.
>
what should I do fix this problem ?
Answer is:
find the CCConfiguration.o. It is in the dir of Cocos2d-x root.
my project dir: D:2d-2.0-x-2.0.4\cocos2d-2.0-x-2.0.4\Cocos2dxSimpleGame;
root dir : D:2d-2.0-x-2.0.4\cocos2d-2.0-x-2.0.4delete all files in D:2d-2.0-x-2.0.4\cocos2d-2.0-x-2.0.4\Cocos2dxSimpleGame\proj.android\obj\local\armeabi\objs-debug
(Note the inline code highlights in the message - they explain the debugging/thought process)
Akarsh Middha wrote:
make: ***** No rule to make target `/cygdrive/@d/android/cocos2d-x-master@/T12/proj.android/…/…/@cocos2dx/CCConfiguration.cpp', needed by `obj@/local/armeabi/objs/cocos2dx_static/@CCConfiguration.o`'. Stop.
Is it possible that you copied this project from another drive/computer/cocos2d-x environment? Or to put it another way, do you have D:2d-x-master\\cocos2dx\\CCConfiguration.cpp@ on your computer? Your current project directory has a built obj, CCConfiguration.o, which is looking for the corresponding cpp source in the location it was *originally compiled* from/in. To “fix”, you must**clean** the project. This may either be done by deleting the objdirectory in your Project’sproj.androiddirectory or build running the build script with the clean option/parameter -build_native.sh clean. Following this, you must compile all the (native) sources again using build_native.sh`.
Hi Pipero…I have the same problem not getting what is the problem.I included myself created static library and cpp files.If u found solution please let me know….
Hello All,
I m working on xcode and eclipse with cocos2dx version 2.1.2
Code is working fine in xcode for ipad.
With same code I create a new eclipse project.
My project required juce and protobuffer library.So i made separate android.mk for both of them put respective cpp files and used Build static command to build that (as same as cocos2dx,cocosdension and extension android.mk files).
In my main android.mk(under jni folder) i gave my static libraries name and respective paths.
$(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,extensions)$(call import-module,myprojectname/Library)$(call import-module,myprojectname/RUIComponents)$(call import-module,myprojectname/proj.android/JuceMakeFile)$(call import-module,myprojectname/proj.android/OpenSourceMakeFile)
Project is building properly.I am getting all object files inside myprojectname/proj.android/obj/local/armeabi and libgame.so inside
myprojectname/proj.android/libs/armeabi/libgame.so
all things are proper but when i launch its giving black screen with logcat message
trying to load lib /data/data/org.apps.test/lib/libgame.so
Fatal signal 11.(sigsegv)
I m not getting what is the problem y its not able to load.If any1 knows about it Plz reply.
It is related with cocos2dx version?
Thanks
Hello All,
I m working on xcode and eclipse with cocos2dx version 2.1.2
Code is working fine in xcode for ipad.
With same code I create a new eclipse project.
My project required juce and protobuffer library.So i made separate android.mk for both of them put respective cpp files and used Build static command to build that (as same as cocos2dx,cocosdension and extension android.mk files).
In my main android.mk(under jni folder) i gave my static libraries name and respective paths.
$(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,extensions)$(call import-module,myprojectname/Library)$(call import-module,myprojectname/RUIComponents)$(call import-module,myprojectname/proj.android/JuceMakeFile)$(call import-module,myprojectname/proj.android/OpenSourceMakeFile)
Project is building properly.I am getting all object files inside myprojectname/proj.android/obj/local/armeabi and libgame.so inside
myprojectname/proj.android/libs/armeabi/libgame.so
all things are proper but when i launch its giving black screen with logcat message
trying to load lib /data/data/org.apps.test/lib/libgame.so
Fatal signal 11.(sigsegv)
I m not getting what is the problem y its not able to load.If any1 knows about it Plz reply.
It is related with cocos2dx version?
Thanks