Cordova build problems after import google play service

后端 未结 2 361
独厮守ぢ
独厮守ぢ 2021-01-06 07:17

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 A

2条回答
  •  清酒与你
    2021-01-06 07:55

    UPDATE: You can also use this plugin OR you can add this line in your plugin.xml to add this plugin as dependency.

    
    

    Follow these steps to solve the problem:

    1. First copy the whole google-play-services_lib folder from ANDROID_SDK_PATH\extras\google\google_play_services\libproject\ to your project root directory.(i.e. platform/android)
    2. copy build.xml, local.properties & project.properties files from your project_root_folder/Cordova lib folder to google-play-services_lib folder.
    3. Change the project.properties file's project target to the right target (i.e. android 19).
    4. Open the project.properties from your Project Root folder and change reference 2 like this :

      android.library.reference.1=CordovaLib

      target=android-19

      android.library.reference.2=google-play-services_lib

    5. Goto the google-play-services folder in your project and run :

      android update project -p . (don't forget dot)

    6. Then run following commands:

      ant debug

      ant release

    7. If you get any error then first run 'ant clean debug' then follow step 6.

    8. Now you can run cordova build android OR if you are using ionic then ionic build android.

提交回复
热议问题