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

After i imported plugins from sdkbox in COCOS CREATOR my app wont build and compile now... PLEASE HELP

$
0
0

@freshprince wrote:

Putting task artifact state for task ‘:WhatYuhKnow:validateSigningRelease’ into context took 0.0 secs.
Executing task ‘:WhatYuhKnow:validateSigningRelease’ (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:WhatYuhKnow:validateSigningRelease (Thread[Task worker Thread 3,5,main]) completed. Took 0.256 secs.
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxHelper.java:96: error: cannot find symbol
private static ZipResourceFile sOBBFile = null;
^
symbol: class ZipResourceFile
location: class Cocos2dxHelper
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxHelper.java:198: error: cannot find symbol
public static ZipResourceFile getObbFile()
^
symbol: class ZipResourceFile
location: class Cocos2dxHelper
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:3: error: package com.loopj.android.http does not exist
import com.loopj.android.http.AsyncHttpClient;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:4: error: package com.loopj.android.http does not exist
import com.loopj.android.http.AsyncHttpResponseHandler;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:5: error: package com.loopj.android.http does not exist
import com.loopj.android.http.BinaryHttpResponseHandler;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:6: error: package com.loopj.android.http does not exist
import com.loopj.android.http.FileAsyncHttpResponseHandler;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:7: error: package com.loopj.android.http does not exist
import com.loopj.android.http.RequestHandle;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:9: error: package cz.msebera.android.httpclient does not exist
import cz.msebera.android.httpclient.Header;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:10: error: package cz.msebera.android.httpclient.message does not exist
import cz.msebera.android.httpclient.message.BasicHeader;
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:19: error: cannot find symbol
class DataTaskHandler extends BinaryHttpResponseHandler {
^
symbol: class BinaryHttpResponseHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:51: error: cannot find symbol
public void onFailure(int i, Header[] headers, byte[] errorResponse, Throwable throwable) {
^
symbol: class Header
location: class DataTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:61: error: cannot find symbol
public void onSuccess(int i, Header[] headers, byte[] binaryData) {
^
symbol: class Header
location: class DataTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:217: error: cannot find symbol
private AsyncHttpClient _httpClient = new AsyncHttpClient();
^
symbol: class AsyncHttpClient
location: class Cocos2dxDownloader
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:67: error: cannot find symbol
class HeadTaskHandler extends AsyncHttpResponseHandler {
^
symbol: class AsyncHttpResponseHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:88: error: cannot find symbol
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
^
symbol: class Header
location: class HeadTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:102: error: cannot find symbol
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable throwable) {
^
symbol: class Header
location: class HeadTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:112: error: cannot find symbol
class FileTaskHandler extends FileAsyncHttpResponseHandler {
^
symbol: class FileAsyncHttpResponseHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:155: error: cannot find symbol
public void onFailure(int i, Header[] headers, Throwable throwable, File file) {
^
symbol: class Header
location: class FileTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:165: error: cannot find symbol
public void onSuccess(int i, Header[] headers, File file) {
^
symbol: class Header
location: class FileTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:204: error: cannot find symbol
RequestHandle handle;
^
symbol: class RequestHandle
location: class DownloadTask
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:205: error: cannot find symbol
AsyncHttpResponseHandler handler;
^
symbol: class AsyncHttpResponseHandler
location: class DownloadTask
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxHelper.java:169: error: cannot find symbol
Cocos2dxHelper.sOBBFile = APKExpansionSupport.getAPKExpansionZipFile(Cocos2dxActivity.getContext(), versionCode, 0);
^
symbol: variable APKExpansionSupport
location: class Cocos2dxHelper
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:35: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:45: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:50: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:60: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:217: error: cannot find symbol
private AsyncHttpClient _httpClient = new AsyncHttpClient();
^
symbol: class AsyncHttpClient
location: class Cocos2dxDownloader
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:330: error: cannot find symbol
Header[] headers = null;
^
symbol: class Header
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:334: error: cannot find symbol
List list = new ArrayList();
^
symbol: class Header
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:334: error: cannot find symbol
List list = new ArrayList();
^
symbol: class Header
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:335: error: cannot find symbol
list.add(new BasicHeader(“Range”, “bytes=” + fileLen + “-”));
^
symbol: class BasicHeader
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:336: error: cannot find symbol
headers = list.toArray(new Header[list.size()]);
^
symbol: class Header
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:87: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:91: error: cannot find symbol
Header elem = headers[i];
^
symbol: class Header
location: class HeadTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:101: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:129: error: cannot find symbol
_initFileLen = getTargetFile().length();
^
symbol: method getTargetFile()
location: class FileTaskHandler
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:133: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:143: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:148: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:154: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:164: error: method does not override or implement a method from a supertype
@Override
^
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxDownloader.java:182: error: cannot find symbol
File tempFile = getTargetFile();
^
symbol: method getTargetFile()
location: class FileTaskHandler
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
44 errors
:libcocos2dx:compileReleaseJavaWithJavac FAILED
:libcocos2dx:compileReleaseJavaWithJavac (Thread[Task worker,5,main]) completed. Took 37.081 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:libcocos2dx:compileReleaseJavaWithJavac’.

Compilation failed; see the compiler error output for details.

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

BUILD FAILED

Total time: 2 mins 2.006 secs
Stopped 0 worker daemon(s).
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ‘:libcocos2dx:compileReleaseJavaWithJavac’.] from daemon DaemonInfo{pid=8648, address=[607027fc-329f-46f9-8600-346377831a9f port:49903, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Busy, lastBusy=1508461540725, context=DefaultDaemonContext[uid=f396cf28-4300-46e2-8f2a-1fd76cbc895f,javaHome=C:\Program Files\Java\jdk1.8.0_152,daemonRegistryDir=C:\Users\Freshprince.gradle\daemon,pid=8648,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
Error running command, return code: 1.

Posts: 1

Participants: 1

Read full topic


Any plan to support arkit on ios

Cocos Creator Simulator Sounds Missing

$
0
0

@abhimanyu wrote:

Hi,

I’m using Cocos Creator 1.6.1. Recently, an issue has started showing up in the simulator. It does not play any sound while testing my game in simulator. The following error repeats every time there’s a sound to be triggered.

Simulator: E/AudioDecoder (64): (status != noErr) failed, message: ExtAudioFileOpenURL FAILED, Error = 0
Simulator: D/AudioEngine-inl.mm (462): AudioEngineImpl::_play2d, cache was destroyed or not ready!

This issue does affect the actual build, as I am able to hear all sounds on the real device. But on simulator, there is no sound at all.

Posts: 1

Participants: 1

Read full topic

Error when build project with release mode in window

Why do we use this sign (*) when declaring variables?

$
0
0

@mhmtemnacr wrote:

Hi all,

I wonder why do cocos2d-x programmers use this sign when declaring cocos2d variables like this:

Sprite* mySprite = Sprite::create( ..... );

I mean the star sign which comes after “Sprite”.

Posts: 2

Participants: 2

Read full topic

cc.ResolutionPolicy.NO_BORDER, getVisibleOrigin/Size(); in canvas web

$
0
0

@devilator wrote:

Hello,

why getVisibleSize and getVisibleOrigin do not return the right values in canvas mode?

in CCDirectorCanvas.js:

_p.getVisibleSize = function () {
    //if (this._openGLView) {
    //return this._openGLView.getVisibleSize();
    //} else {
    return this.getWinSize();
    //}
};

_p.getVisibleOrigin = function () {
    //if (this._openGLView) {
    //return this._openGLView.getVisibleOrigin();
    //} else {
    return cc.p(0, 0);
    //}
};

Posts: 1

Participants: 1

Read full topic

cc.view.resizeWithBrowserSize(true) not working

$
0
0

@devilator wrote:

Hello

cc.view.resizeWithBrowserSize(true); does not work

a fix i found is to change in CCEGLView.js. line 128:
_orientationChanging: true to _orientationChanging: false

Is this a bug or it needs to be true for some reason ?

Posts: 1

Participants: 1

Read full topic

C++17 support for Android/iOS?

$
0
0

@Sleicreider wrote:

Hey,

Has anyone successfully used C++17 for Android and iOS?
I can’t test iOS atm, but i tried to enable it on android but it seems like it doesn’t work?
“unrecognized command line option ‘-std=c++17’”

as far as i know it should work with NDK 15

Posts: 1

Participants: 1

Read full topic


TMX Tiled Map Asset Loading

$
0
0

@abhimanyu wrote:

Hi @slackmoehrle,

I’ve got 2 nodes which have cc.TiledMap components. Can you let me know how to change their TiledMap in runtime on Cocos Creator. I tried the following, and the emulator crashes without an error.

this.scrollBg1.getComponent(cc.TiledMap).tmxAsset = new cc.TiledMapAsset( bgURL );

Posts: 1

Participants: 1

Read full topic

Box2d b2Island class Solve broken in 3.16 release

$
0
0

@tpheikki wrote:

I updated my cocos2d-x version from 3.12 to 3.16. I wondered why physics does not work correctly and crashes in some situations in b2Island::Solve method.

In the following code it seems that indexing to m_joints array has a wrong index variable. In my opinion there should be j instead of i:

// Solve position constraints
timer.Reset();
bool positionSolved = false;
for (int32 i = 0; i < step.positionIterations; ++i)
{
	bool contactsOkay = contactSolver.SolvePositionConstraints();

	bool jointsOkay = true;
	for (int32 j = 0; j < m_jointCount; ++j)
	{
		bool jointOkay = m_joints[i]->SolvePositionConstraints(solverData);
		jointsOkay = jointsOkay && jointOkay;
	}

	if (contactsOkay && jointsOkay)
	{
		// Exit early if the position errors are small.
		positionSolved = true;
		break;
	}
}

Do you agree with me?

In addition, in win32 project someone had probably accidentally included an unnecessary command

“xcopy “D:\bamtang\git\cocos2d-x\tests\game-controller-test\Resources\ipadhd” “C:\testing\cocos2d-x-3.16\build\Debug.win32\game-controller-test” /D /E /I /F /Y”

It seems to reference to some hard-coded location in someone’s own computer.

Posts: 1

Participants: 1

Read full topic

convertToNodeSpace by itself

$
0
0

@elitdie wrote:

Hello! Have a following code (just for realizing processes):

cc.log('enemy position: ' + this.node.getPosition())
cc.log('enemy world space' + this.node.convertToNodeSpace(this.node.getPosition()))

Enemy has parent with Anchor Point (0,0).
And output:

enemy position: (1638.13, 164.66)
enemy world space(115.50, 0.00)

What the hell? Why 115.50? What is it? Whence?

Posts: 1

Participants: 1

Read full topic

Problem with my coins

$
0
0

@mhmtemnacr wrote:

Hi all,

I added coin system to my horizontal runner game. I add coin groups with interval, to the scene. Some time after first coin group appears, I add second group. Every coin group includes 3 to 9 coins inside. I hope I could explain it.

My coins are sliding, everything is ok but I have some problems. There is too much distance between my coins (please look at the Screenshot below). I know my coins look ugly. But I will make a new coin texture soon.

mycoins

Here is my code, where I specify positions of my coins:

bool CoinGroup::init(std::string strPattern, Texture2D *texture1)
{
	if (!Node::init())
	{
		return false;
	}
	
	pattern = strPattern;
	if (pattern.find("-") != std::string::npos) {
		patterns = split(pattern, "-");
	}
	else {
		patterns.push_back(pattern);
	}
	coinRadius = 64.f;

	float lastLocationX = 0.f;

	for (int line = 0; line < patterns.size(); line++) {

		lastLocationX = 0.f;

		for (int i = 0; i < patterns[line].size(); i++)
		{
			if (patterns[line].at(i) == '1')
			{
				Sprite* sprCoin = Sprite::createWithTexture(texture1);

			if (line % 2 == 0) {
					sprCoin->setPosition(lastLocationX, line*coinRadius);
				}
				else {
					sprCoin->setPosition(lastLocationX+(coinRadius/2.f), line*coinRadius);
				}

				sprCoin->setRotation(RandomHelper::random_int(0, 359));
				this->addChild(sprCoin);
			}

			lastLocationX += coinRadius + 8.f;
		}
	}

	return true;
}

My coin width is 64 pixels. And I want to make the distance only 8 pixels. But my coin distance appears to be too much.

strPattern is a string which is randomly selected between these strings:

coinPatterns.push_back("111");
coinPatterns.push_back("111-11");
coinPatterns.push_back("11111");
coinPatterns.push_back("111111");
coinPatterns.push_back("111-1111");
coinPatterns.push_back("111111111");

‘-’ character should split coins to 2 different lines, but it doesn’t. My coins appear in just 1 line all the time.

How can I solve my problems?
Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Do you have any plan support language code

$
0
0

@pineoc wrote:

Hi, cocos2dx team.
I want to know language code support.
(like zh-hant, zh-hans language type)

thanks

Posts: 1

Participants: 1

Read full topic

Error display game in window

$
0
0

@quyetpv wrote:

Hi all,
Please support me.
I create game with cocos2dx 3.5. I create setup file and install im my computer it run ok.
But when i install it on other computer the game is black screen and don’t display any image. When i click in the position exit game it is active and close game.
Please help me soon!

Thanks,

Posts: 1

Participants: 1

Read full topic

How to change a password in cocos2d-x forum site?


AnchorPoint problem in Animation

$
0
0

@tranthor wrote:

Hi,
I have 9 frames in my Animation. The animation is a boy raising his hand. All frame images are transparent. The boy is always in the same position. The AnchorPoint is the default (0.5, 0.5).

The problem that i’m having is that the AnchorPoint position is automatically recalculating by coco2d-x framework as the frames are changing. This is for always mantein the value 0.5, 0.5. Because of this, the position of the frames is moving automatically despite of i’m not changing the setPosition. Why it’s moving? Because is not the same the AnchorPoint 0,5. 0,5 of a boy raising his hand in comparation that the first frame that he’s not raising his hand.

If I add some draws at the left and right bottom of the image, this problem is solved.
The question is, It’s a coco2d-x bug? @zhangxm. I think the framework should be consider all of the image for set the AnchorPoint position. It sounds like actually, it’s ignoring the transparent font.

Posts: 1

Participants: 1

Read full topic

EditBox in single line mode

$
0
0

@tpheikki wrote:

If I create a cocos2d::ui::EditBox component to a user inteface and set its input mode to value ui::EditBox::InputMode::SINGLE_LINE as I need only single line inputs in my use case. However, when I press enter a beep sound is played. For me this gives a feeling of an error.

In multiline mode the sound is not played but a separate mouse button click outside the EditBox region is needed to get the entered value accepted in the edit box. This causes extra work for the user.

This happens in Windows project.

Is there any chance to get rid of the beep sound in the single line mode?

Posts: 1

Participants: 1

Read full topic

Black Screen on iOS Device - Cocos2d-x 2.1.5

$
0
0

@jerrybrace wrote:

I’m attempting to update an older game that I’ve built using Cocos2d-x version 2.1.5 and when running it on an iOS device the screen is rendered completely black. I can hear the game working, but no visual on screen. If I run it using the simulator everything displays correctly.

I’d greatly appreciate any tips anyone might have!

Posts: 1

Participants: 1

Read full topic

9patch and setBackGroundImageCapInsets

$
0
0

@mars3142 wrote:

Can someone explain how the correct usage of a 9 patch is? I found setBackGroundImageCapInsets, but I don’t understand it. I’m using 3.16, if it’s important to know.

Posts: 1

Participants: 1

Read full topic

Best tools to use for developing cocos2d-x android game

$
0
0

@mavios wrote:

Hi,

I am new here and trying to start developing android games with cocos2d-x. I have been lurking around this forum for few days now trying to figure out what to tool I need to use to kick start developing an android game.

I started first trying to configure cocos2d-x 3.16 on visual studio with 2015 with update 3. I quickly learned it wasn’t working, went and read installation guides and noticed that I needed to use v 3.13.1 and a special template. Didn’t have much luck their either. So I decided to look for other alternatives.

My next alternative was using android studio, I installed it and I was able to run cpptest on my device (samsung S8). Couldn’t run that same project on the default emulator because it kept crashing at start.

Next I tried to run a helloWolrd sample and I got the same problem of app crashing at start on both device and emulator.
The thing is that I am a total beginner when it comes to android development I have no past experience developing apps in android.

So my questions are:
Is android-studio currently the best way to use for cocos2d-x using C++? I read somewhere in this forum that I can setup gradle so I don’t need to use command-line compile code, what setting should that be? I also noticed that android studio does a lot of downloading when on the first start and it did almost everything automatically to get cpptest to work, but is there a preferred setting? any API that isn’t supported yet?
Would be nice if there is a detailed instructions on how to start a helloWorld project and the best way to modify the C++ code in android.

Is there a better IDE to use for android that can support latest android API?

Is there thing I better try to learn before developing C++ android games with cocos2d-x? like may be developing C++ android apps with android-studio?

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Viewing all 17068 articles
Browse latest View live


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