Search code examples
androidcordovajargoogle-play-servicescordova-plugin-proguard

Why google-play-service is not found in my phonegap app as I already add the latest jar?


I am trying custom cordova plugin for GCM. I have included latest google-play-service.jar in project's libs folder and <meta-data android:name="com.google.android.gms.version" android:value="5089000" /> in AndroidMenifest.xml. But still facing this problem...

    E/GooglePlayServicesUtil( 2808): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
W/GooglePlayServicesUtil( 2808): Google Play services out of date.  Requires 5089000 but found 4452030

I am developing android app on phonegap. I have found this error message in console window. I supposed to follow this Install the Google Play services SDK, but did't found any build.gradle and proguard-rules.txt

Can any one tell the actual reason? How can I include google-play-service in my phonegap project in an appropriate way? Please help me. I am looking forward to hear from you soon. Thank you.


Solution

  •  E/GooglePlayServicesUtil( 2808): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
    

    This problem has been solved. The solution has beed found here Cordova build problems after import google play service Google play service resources were missing from my phonegap project even after adding the google-play-service.jar in libs folder. So I had to configure the phonegap project. Steps are (copied from the link)...

    1. Firstly 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). 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
    4. Goto the google-play-services folder in your project and run : android update project -p . (don't forget dot)
    5. Then run following commands: ant debug ant release If you get any error then first run 'ant clean debug' then follow step
    6. Now you can run cordova build android OR if you are using ionic then ionic build android.