How can I use google play services in a maven project?

前端 未结 3 1454
醉梦人生
醉梦人生 2020-12-16 14:38

Somebody can give me a step by step tutorial about how can I use google play services in a maven project? I\'ve added two dependencies


           


        
3条回答
  •  眼角桃花
    2020-12-16 15:39

    After importing the google-play-services_lib project into your Eclipse workspace and making it a library you need to setup the maven build process.

    Make a zip file of the "google-play-services_lib" folder and call it "google-play-services_lib.apklib"

      + google-play-services_lib.apklib
         + src
         + res
         + AndroidManifest.xml
         + project.properties
    

    Open the command prompt and go to the folder where the zip file is and type the following command. This will install the apklib into you local maven repository.

    mvn install:install-file -Dfile=google-play-services_lib.apklib -DgroupId=com.google.android.gms -DartifactId=google-play-services -Dversion=14.0.0 -Dpackaging=apklib

    Now you need to install the google-play-services jar into your local repository.

    mvn install:install-file -Dfile=google-play-services.jar -DgroupId=com.google.android.gms -DartifactId=google-play-services -Dversion=14.0.0 -Dpackaging=jar

    Go back into Eclipse and open your android pom file and enter the following dependency

    
      com.google.android.gms
      google-play-services
      14.0.0
      apklib
        
    
    
      com.google.android.gms
      google-play-services
      14.0.0
    
    

    Now you can run your maven package command to have output update with the google play jar and the apklib merged into your apk file.

    mvn package -Pandroid -Psign

提交回复
热议问题