Quantcast
Channel: Cocos Forums - Latest topics
Viewing all 17118 articles
Browse latest View live

Build GooglePlayService in Android Fail with CocosCreator

$
0
0

@RazgrizHsu wrote:

Hi,

I create new project to try SDKBox to build GooglePlayService in android

i'm using
CocosCreator: 1.5beta3
SDKBox Plugin: 1.0.2 ( download from PluginStore )

The error log as

Not using incremental javac compilation.
Not using incremental javac compilation.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':SDKBox'.
> NDK not configured. 
  Download it with SDK manager.)

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 4.723 secs
Stopped 0 compiler daemon(s).
Error running command, return code: 1.

the message tell me the NDK not configured,
But NDK already setting in my CocosCreator

and i can see other part is build success with NDK, except here

here is full log..
native.log.zip (18.7 KB)

anyone can help me?
how do i resolve this error?

Thanks :smiley:

Posts: 1

Participants: 1

Read full topic


Admob crashing during scene transition after showing ad

$
0
0

@clearmend wrote:

I show an interstitial ad before I do a scene transition. I do the transition in the adViewDidDismissScreen method. But the game crashes, I think because of autocaching. If I move the scene transition to adViewDidReceiveAd, there is no crash.

Can I disable auto caching on Admob after showing an ad? I don't want to be waiting for a new ad to cache before doing a scene transition.

Posts: 1

Participants: 1

Read full topic

Add plugin to Babel compiler

$
0
0

@trungnt85 wrote:

Hi @slackmoehrle @nantas

I would like to use Object rest spread transform with Cocos creator 1.5 beta 3 , due to this link https://babeljs.io/docs/plugins/transform-object-rest-spread/ I can use it via babel plugin, how can I install this plugin with Cocos Creator

P/S:
const person = { name: 'David Walsh', gender: 'Male' };
const tools = { computer: 'Mac', editor: 'Atom' };
const summary = {...person, ...tools};

above code can be compiled with Cocos creator 1.4.0 but failed with 1.5 beta

Posts: 1

Participants: 1

Read full topic

Creator not starting on mac

$
0
0

@darksepho wrote:

Hi, I'm trying to run Cocos Creator on a Mac with OS X Yosemite. I see the dashboard, but when I open a project nothing shows up, only the menu bar changes.. Any help?

Posts: 1

Participants: 1

Read full topic

Extern in android

$
0
0

@Darvydas wrote:

Hello guys,

I have compiled game for android it installs but crashes after that. The erros message in eclipse LogCat does not say very much, so I started tracking the issue in code. After some time I found that extern in my Constants.cpp crashes it. (It is only for android. iOS, MacOS and win32 is ok)

Constants.cpp

#include "Constants.hpp"
using namespace cocos2d;
cocos2d::UserDefault *userDefaults = cocos2d::UserDefault::getInstance();

Constants.hpp

#include "cocos2d.h"
extern cocos2d::UserDefault *userDefaults;

Can someone sy what is incorrect and how to fix it?

Posts: 1

Participants: 1

Read full topic

Cocos2dJS: Some TTF fonts work and Some don't when compiling for iOS. Why is that?

$
0
0

@suroorwijdan wrote:

I am currently facing this problem with custom TTF fonts. I used the Marker Felt.ttf font from the examples and it works on browser and also when compiling to native iOS. But as soon as i switch the font to my another custom ttf font, it breaks and defaults to system font.

Also one thing to note, if i change the filename of the Marker Felt.ttf font and use the new name, it also breaks. Is there any other way Cocos2dx reads font on native?

I am using Cocos2dJS

Versions:
cocos2d-x-3.13.1
Cocos Console 2.1

Is anybody facing a problem, or am i missing something basic here?

Posts: 1

Participants: 1

Read full topic

Undefined reference to 'sdkbox::GPGWrapper::NotifyToScripting

$
0
0

@Deeds wrote:

Hello,

I'm trying to integrate Google Play Games Services (GPGS) into my Cocos2d-x project by following this guide: Manual Integration For Android.

The problem is that when I'm trying to compile the Cocos project on the command line using "cocos compile -p android --android-studio", I get the following errors:

jni/src/GPGNearbyConnections-android.cpp:78: error: undefined reference to 'sdkb
ox::GPGWrapper::NotifyToScripting(int, std::string const&)'
jni/src/GPGNearbyConnections-android.cpp:88: error: undefined reference to 'sdkb
ox::GPGWrapper::NotifyToScripting(int, std::string const&)'
jni/src/GPGNearbyConnections-android.cpp:132: error: undefined reference to 'sdk
box::GPGWrapper::NotifyToScripting(int, std::string const&)'
jni/src/GPGNearbyConnections-android.cpp:142: error: undefined reference to 'sdk
box::GPGWrapper::NotifyToScripting(int, std::string const&)'

The Cocos2d-x version is 3.13 and the GPGS files are downloaded from here https://github.com/sdkbox/sdkbox-sample-gpg.

The sample project was built successfully.

Posts: 1

Participants: 1

Read full topic

Integration GooglePlayGameService with CocosCreator

$
0
0

@RazgrizHsu wrote:

Hi,

i'm newer for SDKBOX,
I'm trying Integration Google PlayGameService with CocosCreator,

i using build template is default, and added these service..

and i success build native project

after these steps,

now i trying add the code from HelloWorld scene in Javascript ..

but error occcur in my code

sorry for my stupid,
how to i correct using this service in CocosCreator ?

Thanks :smiley:

Posts: 1

Participants: 1

Read full topic


Creating desktop application under linux

$
0
0

@v2003 wrote:

I see that many people successful use eclipse to develop under linux. But is it possible to use many aspects of cocos architecture, like binding custom classes, or enableing debug?
I don't want testing on android or ios, becouse it isn't modile game.
P.S.: I'm developing game using lua.

Posts: 1

Participants: 1

Read full topic

Android studio sdkbox iap error: undefined modules: android_native_app_glue

$
0
0

@clearmend wrote:

Things just aren't going my way these last few days! After installing and setting up iap, everything works fine on xcode/ios. But then I open Android Studio and Gradle project sync fails with error:

Error:(686, 0) Android NDK: Module MyGame_shared depends on undefined modules: android_native_app_glue

Do I have to move to earlier version of tools or sdk or ndk? I'm not sure what to do.

My android.mk has everything as far as I can tell:

LOCAL_CPPFLAGS := -DSDKBOX_ENABLED
LOCAL_LDLIBS := -landroid \
-llog
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes
LOCAL_WHOLE_STATIC_LIBRARIES := PluginAdMob \
sdkbox \
PluginIAP \
android_native_app_glue

Posts: 3

Participants: 2

Read full topic

Proper way to set Node visible flag?

$
0
0

@qwpeoriu wrote:

I'm familiar with Cocos2d-x but brand new to Cocos Creator and trying to figure stuff out. What is the proper way to set the visible flag for the cc.Node's SG Node? I realize this is probably a stupid question, but I cannot figure out the proper way to handle this by looking at the API. cc.Node has several properties that map to _ccsg.Node (color, opacity, z-order, etc...), but the visible flag isn't one of them.

I suppose I could simply call this._sgNode.setVisible(), but I feel like I'm missing something since the visible flag wasn't declared in cc.Node like the rest of the mapped properties. There must be a good reason for that, perhaps I can achieve what I want by setting the active flag?

Posts: 1

Participants: 1

Read full topic

Google Play Game Service error "Please provide a valid serverClientId"

$
0
0

@RazgrizHsu wrote:

Hi, Dear all..

i'm success integration Google Play Game Service with CocosCreator,

SDKBOX - Plugin Version: 1.0.3
Google Play Services Version:

when i put apk to phone to running,
i'm always getting error ..
Exception in com/google/android/gms/games/Games.getGamesServerAuthCode: java.lang.IllegalArgumentException: Please provide a valid serverClientId.

here is my JavaScript code ..

        var config = new gpg.PlatformConfiguration();
        config.SetClientID('239759943429-3v8bd9ea3j1vcmq7c965ic8deq7gs2gh.apps.googleusercontent.com');

	cc.log( '[GPG] Start Build Game Service.' );
        new gpg.GameServices.Builder()
        .SetOnAuthActionStarted( function( result )
        {
            cc.log( '[GPG] on auth started: ' + result.AuthOperation + '\n' );
        })
        .SetOnAuthActionFinished( function( result )
        {
            cc.log( '[GPG] on auth finished: ' + result.AuthOperation + ' -> ' + result.AuthStatus + '\n';
        })
        .SetLogging( gpg.LogLevel.VERBOSE )    // Set Logging level
        //.EnableSnapshots()                  // Enable Snapshot (Saved Game) functionailty
        .Create( function( game_services )
        {
            cc.log( 'Game Services Created!!!!\n' );
        } );
        cc.log( '[GPG] End Build Game Service.' );

and my part adb log is..

V/GamesNativeSDK(20912): Play Games callback indicates connection.
W/GamesServiceBroker( 4298): Client connected with SDK 8487000, Services 10298030, and Games 39080030
I/GamesNativeSDK(20912): Successfully connected to Google Play.
V/GamesNativeSDK(20912): WelcomeBack Notification UI should be displayed by GMSCore.
V/GamesNativeSDK(20912): ApplicationMetadataCache is not being seeded; this is normal on non-iOS platforms.
V/GamesNativeSDK(20912): PlayerLevelCache is not being seeded; this is normal on Android.
V/GamesNativeSDK(20912): QuestCache is not being seeded; this is normal on Android.
D/dalvikvm( 4298): GC_FOR_ALLOC freed 502K, 48% free 15774K/30120K, paused 36ms, total 36ms
I/dalvikvm-heap( 4298): Grow heap (frag case) to 17.425MB for 921616-byte allocation
E/SMD     (20633): smd Interface open failed errno is 2 -1
D/dalvikvm( 4298): GC_FOR_ALLOC freed 19K, 47% free 16655K/31024K, paused 32ms, total 32ms
E/GamesNativeSDK(20912): Exception in com/google/android/gms/games/Games.getGamesServerAuthCode: java.lang.IllegalArgumentException: Please provide a valid serverClientId.
F/libc    (20912): !@Fatal signal 11, thread 20956
F/libc    (20912): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 20956 (main_dispatch)
W/AppOps  ( 3383): Bad call: specified package com.google.android.play.games under uid 10291 but it is really 10127
W/AppOps  ( 3383): Bad call: specified package com.google.android.play.games under uid 10291 but it is really 10127
W/AppOps  ( 3383): Bad call: specified package com.google.android.play.games under uid 10291 but it is really 10127
W/AppOps  ( 3383): Bad call: specified package com.google.android.play.games under uid 10291 but it is really 10127
I/DEBUG   ( 2824): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 2824): Build fingerprint: 'samsung/trhpltexx/trhplte:4.4.4/KTU84P/N910UXXU1ANL4:user/release-keys'

you can see the GamesNativeSDK says "Successfully connected to Google Play."

but next get Exception in "Games.getGamesServerAuthCode"....

my strings.xml is

<?xml version='1.0' encoding='UTF-8'?>
<resources>
    <string name="app_name" translatable="false">SDKBOX</string>
    <string name="google_app_id">239759943429</string>
    <string name="service_id">239759943429-3v8bd9ea3j1vcmq7c965ic8deq7gs2gh.apps.googleusercontent.com</string>
</resources>

i don't know why i'm always get the error,
alos trying google it by no any useful information...

please help me , thank you so much :joy:

Posts: 1

Participants: 1

Read full topic

Load .csb files in cocos2d-x 3.15

$
0
0

@PerfectWay wrote:

Hi, all
I had a very important question. I have several ui-scenes created in CocosStudio 2.3.2.
While I was working with the cocos 3.8 everything worked fine, but after the update to 3.15 I had problems.
I heard that the studio is no longer supported by the engine, so I'm interested in the question whether it is possible to convert old csb-scenes to work with a new engine?
Update CocosStudio to v.3.10 can solve it? Or CSLoader was changed after 3.10?

Posts: 1

Participants: 1

Read full topic

Using GLFW for gamepad in Win 10 UWP apps

$
0
0

@mstorch wrote:

Hi all,

Based on other discussions in this forum, I am trying to evaluate using GLFW for gamepad input for my Win10/Xbox UWP game. I am using the proj.win10 Visual Studio (2015) solution and Cocos2d-x 3.15. However, it seems the preprocessor flags for WIN32 and _WINDOWS must be set in order to expose GLFW, and this requires using the VS solution from proj.win32, which I am not using.

I am also evaluating gainput for controller integration, but encountered some other problems there and submitted a GitHub issue on their repo to track them. I may also investigate SDL since both gainput and SDL seem to support rumble functionality, whereas GLFW does not yet (although it's in their plans).

Has anyone build/deployed GLFW functionality with the proj.win10 solution and if so, any pointers on how to get it working?

Thanks a lot!
Mark

Posts: 1

Participants: 1

Read full topic

[Demo && Dev Log] CCDungeons

$
0
0

@supersuraccoon1 wrote:

This is a demo project that I have been working for the last year in my spare time and I took some time the last weekend to wrote a develop log on this demo project.

It is still far from finished and will keep working on it.

If you are interested, you can check the post here in my blog (will keep updating it from time to time) :

ccdungeons_dev_log

And here is a video on youtube: https://youtu.be/l7unCyXo_UU:

Posts: 1

Participants: 1

Read full topic


requestInvitableFriends not working

$
0
0

@suraj wrote:

requestInvitableFriends api not working .

It mentions the application must have a canvas configuration for this API call to work.

How to setup canvas configuration for an app ? There is no such option in settings section of facebook developer section.

Posts: 1

Participants: 1

Read full topic

Detect tabelt or smartphone

$
0
0

@lucaMZ wrote:

Hi!
with cocs2dx in c++, is there a simple way to dectect if my app is running on tablet or on smartphone?
I need this info for tracking/report iusse, not for graphic.
Thanks!
L.

Posts: 1

Participants: 1

Read full topic

Script using event listeners (touch) works in browser but not in simulator

$
0
0

@jfgouhier wrote:

Hello Everybody,

The following script (attached to a layout) works in the browser but not in the simulator, does someone have an explanation?
By the way, I read this topic on the forum, (http://discuss.cocos2d-x.org/t/bug-touch-events-on-mobile-devices-do-not-get-sent-works-on-browsers-though/34940 ) , could it be the same kind of bug (I havent yet tested my script on mobile devices) ?

   cc.Class({
        extends: cc.Component,
        properties: {               
        carreBleu: {default: null, type: cc.Node,},
        carreJaune: {default: null,type: cc.Node,},
        carreRouge: {default: null, type: cc.Node,},
        carreOrange: {default: null,type: cc.Node,},
        },
        // use this for initialization
        onLoad: function () {
            var listener1 = cc.EventListener.create({
            event: cc.EventListener.TOUCH_ONE_BY_ONE,
            swallowTouches: true,
               onTouchBegan: function (touch, event) {      
                	var target = event.getCurrentTarget();
        	        var locationInNode = target.convertToNodeSpace(touch.getLocation());    
	                var s = target.getContentSize();
	                var rect = cc.rect(0, 0, s.width, s.height);
        	        cc.log(s.width);
	                if (cc.rectContainsPoint(rect, locationInNode)) {       
	                    target.opacity = 110;
        	            return true;
                	}
	                return false;
        		},       
               onTouchMoved: function (touch, event) { 
	                var target = event.getCurrentTarget();
        	        var delta = touch.getDelta();
                	target.x += delta.x;
	                target.y += delta.y;
            	},
               onTouchEnded: function (touch, event) {			
    		    	var target = event.getCurrentTarget();
	    		if(target.name="carreBleu"){  
        	           target.opacity=10;}
    		    	}
	        });
      cc.eventManager.addListener(listener1, this.carreBleu);
      cc.eventManager.addListener(listener1.clone(), this.carreJaune);
      cc.eventManager.addListener(listener1.clone(), this.carreRouge);
      cc.eventManager.addListener(listener1.clone(), this.carreOrange);
    },
        });

Posts: 1

Participants: 1

Read full topic

Repositioning sprites mid-action on screen rotation

$
0
0

@0mega wrote:

Hello,

I've been working on one of our apps (a solitaire game for Android & iOS) and I've run into a small issue. We have this animated notification 'banner' that appears into the screen closed and then 'opens up' using the cocos2d-x actions. However, when rotating the screen the sprites are moved out of position (they are based on the screen dimensions, which obviously changes when rotating), and depending on when the user rotates the animation might not be completed yet.

Does anyone have a good idea on how to handle rotations of the screen while sprites are in the middle of an action?

We also animate the cards when you start a new game and when rotating during the animation, we just reset the position and restart the animation, which is not really a graceful way of handling notifications. So I would like to avoid this solution for the notification banner. :')

Posts: 1

Participants: 1

Read full topic

How to compile for x86_64 in android studio?

$
0
0

@clearmend wrote:

So I can't run my game in an emulator because the emulators are using the x86 architecture. I tried installing an emulator with the armeabi architecture but the emulator wouldn't run on my laptop.

Can I compile in Android Studio for x86_64? I tried changing APP_ABI := armeabi to APP_ABI := x86_64 in Application.mk but the game still compiled in armeabi. Is there anyway to force x86_64?

Posts: 1

Participants: 1

Read full topic

Viewing all 17118 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>