app42 Couldn't resolve host, NO result from proxy

0 votes

Hello,

I have just started using app42 with cocos2d-x (currently working on android build)

but i am not able to simply create user or get user info, below is my code

App42API::Initialize(API_KEY, SECRET_KEY);

	UserService *userService = App42API::BuildUserService();
	const char* userName = "smit";
	const char* pwd = "patel";
	const char* emailId = "dummy@nthg.com";

	userService->CreateUser(userName, pwd, emailId, app42callback(MenuLogin::onUserRequestCompleted, this));
// or trying to get user create in dashboard
	userService->GetUser(userName, app42callback(MenuLogin::onUserRequestCompleted, this));

 

in logcat i am getting this error response,

D/libc-netbsd( 3113): getaddrinfo: https%3A%2F%2Fapi.shephertz.com%2Fcloud%2F1.0
%2Fuser%2Fsmit%3F NO result from proxy
D/cocos2d-x debug info( 3113):
D/cocos2d-x debug info( 3113): code=-1...=0
D/cocos2d-x debug info( 3113):
D/cocos2d-x debug info( 3113): Response Body=
D/cocos2d-x debug info( 3113):
D/cocos2d-x debug info( 3113): errordetails:Couldn't resolve host 'https%3A%2F%2
Fapi.shephertz.com%2Fcloud%2F1.0%2Fuser%2Fsmit%3F'
D/cocos2d-x debug info( 3113):
D/cocos2d-x debug info( 3113): errorMessage:
D/cocos2d-x debug info( 3113):
D/cocos2d-x debug info( 3113): appErrorCode:0
D/cocos2d-x debug info( 3113):
D/cocos2d-x debug info( 3113): httpErrorCode:-1
 
I checked in 2 diff devices, also internet is working fine.
Also tested with carrier 3g and wifi but same result.
any idea whats wrong?

 

asked Dec 30, 2015 in Cocos2D-X by smitpatel88 (33 points)
recategorized Feb 4, 2016 by shepAdmin

1 Answer

0 votes
Hello Smit,

This issue may occur if you have not added the internet permission in your android manifest.xml file.

Let me know if this is not the case.

Thanks.
answered Dec 31, 2015 by rajeev.etc (1,660 points)
thanks for reply.
but i added internet permission in manifest file.
also i tried with ios build and same error is showing.
Help me out ASAP.
Please help me out, i almost wasted a week.
Even in sample comes with sdk throwing the same errors.
I have checked the SDK at my end and it is working fine. I have also updated the sample(https://github.com/shephertz/App42_Cocos2DX_SDK/tree/master/App42Cocos2dxSample) which comes with the SDK to be compatible with cocos2dx version 3.7. I have tested it on iOS for now.

Please update the sample from above link and check on iOS and let me know if you face the same problem.
I have the same source, still i replaced it.
I am getting lot of errors regarding 'url_encode'
Earlier i got the same errors, i modified every where 'Util::url_encode' instead of just 'url_encode' to make it successful compile.
I think problem is here only.
Can you suggest me proper solution for this?
There is two method of url_encode 1st in Connector.h and 2nd in urlencode.h
Can you share the error message you are getting due to this method?
Also, SDK uses url_encode method of "urlencode.h", hence you can just delete the one available in "Connector.h".
Can you also try to run the sample i shared without any change , just to check if it runs well at your end, as it is running fine at my end. Before running the sample, place the cocos2d source folder created using cocos2dx-3.7.
Hello Smit,

Are you able to run the sample i shared? Please let me know if you face any problem.

Thanks.
Hi Rajeev,
Yes, your sample is running fine.
Problem was i am using both Appwarp & App42 in my project. so i have to define first App42 classes then Appwarp classes then my own classes in .mk files.
After that it compiles. Still i have to check with iOS, will let you know.
Sry for late reply i put hold on this project for a while.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...