Cordoba creates problems after importing google play service

After the new admob SDK update, now we need to import the google play service project into our projects in order to monetize and show ads in our applications. I am creating an application with Apache Cordova / Phonegap, and I created an Android project with it, and everything was fine. Then I opened my Android project, which created a cordova and imported the google play service lib project and put in all my own code that I need to show ads, and then ... GREAT! Works fine, tested on emulator, NICE, device, EVEN BETTER! But now, when I update my code in the / www folder of the cordova and try to run the command: cordova build android

I always get a build error, so every time I need to update my code and update the android project, I need to delete all the links and google play service codes that I insert into my own android project that generates a cord, starts the build and then add everything again It's a little boring, has someone already gone through this? Does anyone have a better solution? I got an error:

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)
+4
source share
2 answers

UPDATE: You can also use this plugin OR you can add this line to your own plugin.xmlto add this plugin to the dependency.

<dependency id="com.google.playservices" />

To resolve this issue, follow these steps:

  • google-play-services_lib ANDROID_SDK_PATH\extras\google\google_play_services\libproject\ (, /)
  • build.xml, local.properties project.properties project_root_folder/Cordova lib google-play-services_lib.
  • project.properties (.. 19).
  • project.properties Project Root 2 :

    android.library.reference.1 = CordovaLib

    = -19

    android.library.reference.2 = Google--services_lib

  • google-play-services :

    android update project -p . ( )

  • :

    ant debug

    ant release

  • - , "ant clean debug", 6.

  • orroid corova build or or, android.

+8
+1

Source: https://habr.com/ru/post/1542792/


All Articles