SonarSystems / Cocos-Helper

Cocos2d-x external framework helper.
MIT License
120 stars 48 forks source link

Cocos v3.9 compilations fails: SonarFrameworks.h: No such file or directory #41

Closed konikun closed 8 years ago

konikun commented 8 years ago

Hello everyone!

I am using Cocos2d-x v3.9 with javascript. I have a clean javascript project (freshly created with 'cocos new -l js') and I am trying to integrate the cocos helper plugin. I follow your video, up to before the point you open eclipse with ADT. Since ADT is not supported by google anymore, I don't use it.

If I try to generate an apk (via command line, 'cocos compile -p android'), compilation fails with the following error: In file included from jni/../../Classes/JNIResults.cpp:9:0: `jni/../../Classes/JNIResults.h:19:29: fatal error: SonarFrameworks.h: No such file or directory

include "SonarFrameworks.h"`

^ compilation terminated.

I understand we shouldn't need this header file in a javascript project, so what is missing?

thank you in advance!

OscarLeif commented 8 years ago

@konikun I think when you use the command 'cocos compile -p android' you're using ant, or eclipse. @SonarSystems I'm not sure about this answer that I give here maybe I'm wrong I never use cocos2d-js.

@konikun please find this file 'Android.mk' D:\helloJs\frameworks\runtime-src\proj.android\jni \ Example of the path https://www.youtube.com/watch?v=_zKYyUF1SMk Check this time 5:45**

LOCAL_SRC_FILES := hellojavascript/main.cpp \ ../../Classes/JNIHelpers.cpp ../../Classes/JNIResults.cpp ../../Classes/AppDelegate.cpp Edit that files like that example and it must work. It's funny if you fix that I'm sure when you import the project to eclipse it will work. I don't know why cocos team keep eclipse working in order to compile.

SonarSystems commented 8 years ago

Your using ANT as technically Eclipse isn't required, Eclipse is just an IDE.

konikun commented 8 years ago

I've edited the Android.mk file, as you mentioned (+ the separators).

Tried to compile to android using "cocos compile -p android" and got the same error: "SonarFrameworks.h: No such file or directory".

Then I imported the project to Cocos Code IDE, and tried to package the apk. Same error again.

saiy2k commented 8 years ago

Same error happening with Cocos2dx 3.8 and Cocos Helper v1.48.00 in my Mac!

saiy2k commented 8 years ago

Upgrade to Cocos2dx 3.10 and getting the same error. Tried fixing one error and the other error shows up.

After all this steps, the Project compiled successfully. But on app launch, it shows Unfortunately, App has stopped.

Please help.