0

Am using a Java plugin as I am building a very simple SDK for users to fire an HTTP request from their android phone.

My SDK is packages as a JAR which other users can import in their app and use the methods to fire the request.

I use Grade to build my project and get the Jar file. Until now, I was using a older version of Google Play-Services which had a jar file in my android_home/extras/google/google_play_services/libproject/google-play-services-libs/libs

But I upgraded my Google Play Services to latest version I see this path is no longer available. I see a new path and the packaging is changed to .aar.

I tried to follow some of the methods specified in this forum to convert this .aar file into jar and use it as a dependancy but when I unzip I could not see any classes.jar inside this .aar. I could only see AndroidManifest.xml and R.txt

I am unable to use compile fileTree option in Gradle. Please help me on how can I build my project or what modifications I need to do on my build.gradle file?

Current hack that I am doing is manually download the jar file from: https://dl-ssl.google.com/android/repository/google_play_services_3159130_r09.zip and using compile fileTree option. I need to get rid of this manual step.

Looking for suggestions.

Karthik
  • 315
  • 1
  • 4
  • 17
  • Why not have your users import the Google Play Services dependency in gradle? https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project They can simply add `compile 'com.google.android.gms:play-services:+'` – nicobatu Jun 29 '16 at 23:43
  • Java and android plugin are not compatible. So they can't be used in a single gradle file right? Can you elaborate if my assumption of your answer was wrong. Thanks – Karthik Jun 30 '16 at 00:21
  • Please check solutions given in this SO post - [Android Studio: Gradle - build fails — Execution failed for task ':dexDebug'](http://stackoverflow.com/questions/18021901/android-studio-gradle-build-fails-execution-failed-for-task-dexdebug). I hope one of the solutions given helps. – Teyam Jun 30 '16 at 17:23

0 Answers0