SonarSystems / Cocos-Helper

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

AdMobs : google_play_services/build.xml failed #50

Open mariustruica opened 8 years ago

mariustruica commented 8 years ago

Hi guys,

I am trying to make AdMobs to work for my project but when executing build_native.py in command line i am getting an error : ad_mob_error

I have cocos2dx v3.10.

Regards, Marius

OscarLeif commented 8 years ago

You should better use Eclipse it could be bad setup I think I cannot find more reasons to fail. But if you're using AdMobs remember to import google play services and uncomment the lines about Google Play Services.

mariustruica commented 8 years ago

In eclipse , when the application starts i am getting this error (at runtime):

eclipse error

Here are my settings : admob_manifest

google_play_manifest

google_play_properties

project_properties_1

project_properties_2

sonar_frameworksettings

eclipse_solution

SonarSystems commented 8 years ago

Does a fresh project work in Eclipse?

mariustruica commented 8 years ago

a fresh project is the first thing i tried and does not work.... my project worked fine on my phone but when i added AdMob nothing worked... i am using ndk r10e and my phone is a galaxy S3 with android 4.3

OscarLeif commented 8 years ago

@mariustruica Please don't show your banner or interstitial code, well reading your log file it seems that you're using rand() function in the c++ code can you try to compile your game in Visual studio or maybe you can temporaly change the rand() with a number, I'm not sure what the problem could be, rand should work well with android 6 with the NDK 10

mariustruica commented 8 years ago

@OscarLeif Those banners are fakes ... I cannot run even a fresh copy of the project where no rand function is present. On a fresh copy the following error occurs : fresh_project_error

I managed to run build_native.py by using google_play_services rev 22 instead of 29. But when running the project from eclipse i get the same error (the above on) . And of course in VS the project works fine. I think the combination between google_play_services, android api versions , ndk versions are the problem..... can this be a problem on my phone ? i mean the v4.3 android version ?

IN VS i had an error when i added sonarSystems : d:\workspace\cocos2d-x-3.10\tests\testgame\classes\sonarframeworks.cpp(50): fatal error C1017: invalid integer constant expression

if SCH_IS_SOCIAL_ENABLED == true (line 50)

and i solved the error in 2 steps : 1.Project Properties > Configuration Properties > C/C++ > Command Line -Dfalse=0 -Dtrue=1 2.Project Properties > Configuration Properties > C/ C++ / Preprocessor add _XKEYCHECK_H; I run the project in VS 2013.

Can someone tell me what combination of ndk version , google_play_services rev and what android api for each project (cocos2dx , my project and google_play_services ) should i use ?

Regards , Marius