Return to Cocos2dx Playback Library

Cocos2d-x - Android

Questions related to Cocos2dx playback library should be asked here.

Cocos2d-x - Android

Postby Jonathan Reis » July 20th, 2014, 7:27 am

Hello,
I need help using the GAFMedia with cocos2d-x and Android, I got this error:

error: undefined reference to 'GAFAnimatedObject::createAndRun(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)'

Using Xcode with iOS, works well.
User avatar
Jonathan Reis
 
Posts: 14
Joined: July 14th, 2014, 11:32 am

Re: Cocos2d-x - Android

Postby Oleksander Kuznietsov » July 20th, 2014, 12:05 pm

Hello. It looks like a linker error. Make sure that your Android.mk file contains line
Code: Select all
LOCAL_WHOLE_STATIC_LIBRARIES += gafplayer_static
User avatar
Oleksander Kuznietsov
 
Posts: 15
Joined: April 23rd, 2014, 3:58 am

Re: Cocos2d-x - Android

Postby Jonathan Reis » July 20th, 2014, 12:37 pm

My Android.mk is like this and does not work:

Code: Select all
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/HelloWorldScene.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
               $(LOCAL_PATH)/../../../Library \
               $(LOCAL_PATH)/../../../Library/Sources

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += gafplayer_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,audio/android)
$(call import-module,editor-support/cocostudio)
$(call import-module,extensions)
User avatar
Jonathan Reis
 
Posts: 14
Joined: July 14th, 2014, 11:32 am

Re: Cocos2d-x - Android

Postby Oleksander Kuznietsov » July 21st, 2014, 1:27 am

Eclipse doesn't know how to build GAF library to link against. You should find yor GAF folder under the following path:
`cocos2d/external/<GAF_folder>`
and then insert a line to the corresponding section of `Android.mk` file:
Code: Select all
$(call import-module,<GAF_folder>/Library)
User avatar
Oleksander Kuznietsov
 
Posts: 15
Joined: April 23rd, 2014, 3:58 am

Re: Cocos2d-x - Android

Postby Jonathan Reis » July 21st, 2014, 2:41 am

Thank you, worked perfectly with this line:

Code: Select all
$(call import-module,GAFPlayer/Library)
User avatar
Jonathan Reis
 
Posts: 14
Joined: July 14th, 2014, 11:32 am

Re: Cocos2d-x - Android

Postby Daniele Di Bernardo » October 15th, 2014, 12:23 am

I am trying to make this library compile with cocos2d-x 3.2 on Android but with no success. In Xcode everything is working fine.
I've already added to the Android.mk file the two lines suggested:

Code: Select all
LOCAL_WHOLE_STATIC_LIBRARIES += gafplayer_static
$(call import-module,Cocos2dxGAFPlayer/Library)

but when I compile the project via command line + ant I keep getting this error:

Code: Select all
jni/../../Classes/HomeScene.cpp:20:28: fatal error: GAFPrecompiled.h: No such file or directory
 #include "GAFPrecompiled.h"

Do you know how can I fix this error?
User avatar
Daniele Di Bernardo
 
Posts: 1
Joined: October 15th, 2014, 12:20 am

Re: Cocos2d-x - Android

Postby Oleksander Kuznietsov » October 15th, 2014, 1:54 am

Try changing following line in HomeScene.cpp
Code: Select all
#inclulde "GAFPrecompiled.h"

with following:
Code: Select all
#include "../GAFPrecompiled.h"


If this won't get the job done provide please you Android.mk content.
User avatar
Oleksander Kuznietsov
 
Posts: 15
Joined: April 23rd, 2014, 3:58 am

Re: Cocos2d-x - Android

Postby Zhen Wang » December 16th, 2014, 5:16 pm

I add
Code: Select all
'LOCAL_WHOLE_STATIC_LIBRARIES += gafplayer_static'

and
Code: Select all
 '$(call import-module,Cocos2dxGAFPlay/Library)'


but also have this error 'fatal error: 'GAF.h' file not found'.
How fix it?
User avatar
Zhen Wang
 
Posts: 1
Joined: December 8th, 2014, 11:10 pm

Re: Cocos2d-x - Android

Postby Dmitry Bushtets » December 17th, 2014, 6:24 am

Hello!
What repo branch you are using?

And please check in Android.mk, you should have something like:
Code: Select all
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
               $(LOCAL_PATH)/../../cocos2d/external/GafPlayer/Library/Sources
User avatar
Dmitry Bushtets
 
Posts: 86
Joined: August 11th, 2014, 1:31 am

Re: Cocos2d-x - Android

Postby Nate Starke » March 6th, 2020, 3:01 am

It’s a online tool in which you can convert flash animations and create a pure forum for the immediate start. They also provide a proper platform as the edubirdie reliable in graphics and texture.
User avatar
Nate Starke
 
Posts: 1
Joined: March 6th, 2020, 3:01 am

Return to Cocos2dx Playback Library

Who is online

Users browsing this forum: No registered users and 2 guests