After the new update of the admob SDK now we need to import the google play service project to our projects to monetize and show ads in our apps. I am creating an app with Apache Cordova/ Phonegap and I created the android project with it and everything was fine. Then I opened my android project that cordova generated and import the google play service lib project and put all the native code I needed to show ads, then...GREAT! Works fine, tested on emulator, NICE, device, EVEN BETTER! But now when I updated my code on /www folder of cordova and try to run the command:
cordova build android
I always get a build error, so everytime I need to update my code and update the android project I need to remove all the references and codes of google play service I insert at the native android project generate by cordova, run the build command and then add everything again, this is a little bit boring, somebody have already pass through this? Somebody have a better solution? The error I got is this:
BUILD FAILED
/Users/matheus/Development/adt-bundle-mac/sdk/tools/ant/build.xml:601: Invalid file: /Users/matheus/Development/google-play-services_lib/build.xml
Total time: 1 second
Error code 1 for command: ant with args: debug,-f,/Users/matheus/Development/phonegap_projects/TabFipeFree/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/matheus/Development/phonegap_projects/TabFipeFree/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)