Friday, September 30, 2016

How to import Android libraries from GitHub/dandar3 into Eclipse workspace

Showing you today an easier way of importing Android Support and Google Play Services libraries for Android from github.com/dandar3 repositories into your Eclipse workspace.



Prerequisites:

Navigate to:

Choose the project you want to import (e.g. android-support-v7-appcompat).

Scroll down to SVN Checkout section, right-click the Team Project Set URL and choose Copy link to copy it to clipboard.

Switch to Eclipse then navigate to File > Import > Team > Team Project Set.

Paste the address into the URL field (if not already pre-populated from clipboard), then click Finish.

The download (import) may take a short while dependening on your Internet connection.

Once finished, wait for Eclipse to rebuild all projects or manually choose Project > Clean > Clean all projects and check the Start a build immediately both with Build the entire workspace option.

Then you can add the library (or libraries) as a dependency to your application.

14 comments :

  1. Great Dan Great Job,
    I get your job and I trasform it for use with Netbeans and ... works!
    So Now I can continue to use my Netbeans to compile Android 7 App
    I have extended your package, Im compiling a new library: google-play-services-location.jar (you miss!)
    I have used Netbeans 8.1
    Also this works!
    Thanks very much Dan!
    AZ2012 Rome IT

    ReplyDelete
    Replies
    1. You're most welcome, thank you! :-)

      Let me know if you want me to add google-play-services-location to the list.

      Delete
  2. I forgot it's incredibile! You and I like working about the same subjects and ... hear the same music!
    Ciao!

    ReplyDelete
  3. Can you please tell how where I can find the google-play-services_lib directly with google-play-services.jar? thank you

    ReplyDelete
    Replies
    1. That was the old Google Play Services library that contained everything and was causing projects to hit 64K method limit, thus Google decided to split them into separate libraries and with the move to Gradle / Android Studio those are delivered as AARs.

      Use Android SDK Manager to download install Extras > Google Play Services and have a look at ANDROID-SDK\extras\google\m2repository\com\google\android\gms.

      Or have a look at the https://github.com/dandar3/android-google-play-services-README to import project sets directly into Eclipse (the same way as presented in the video in this post)

      Delete
  4. I imported the libraries the way it said in the video but it is still not getting recognized in the import statement of the java class and gives error -"import not resolved". Could you please help? Thank you

    ReplyDelete
    Replies
    1. This is a well known step to most Eclipse Android developers - you need to add the library as a dependency to your app. Right click on your project > Properties > Android > Library section (bottom) > Add...

      Delete
  5. Hi Dan, today I have upgraded your libraries to API 25 and I have included in Netbeans 8.1 IDE
    I use it to write "Google Maps" programs
    It was an hard job, because I must build a new library, that include all your libs.
    Then I must fight with dependences , duplicates and so on. But ... I win!

    Why use I the old version Nebeans 8.1 ? Good question!

    Because Netbeans 8.2 dismiss Ant to adopt Gradle.
    I have thinked BAD!

    If I must use Gradle is better I adopt Android Studio or IDEA, don't have more sense using Netbeans ...

    I hate Gradle because it is a great tool , too great !
    It hide me what it is under the hood, with gradle it is easy loose the direct control about what modules
    are included or excluded by the linker. But I m lucky because exists the great Dandar libs!
    Dandar, I love you jobs, so please, don't stop to do it!
    Ciao Ciao
    AZ2012

    ReplyDelete
    Replies
    1. If I were to suggest something is setting up an Eclipse workspace just for Google Play Services and Android Suppoort Libraries, use the instructions in the video to pull them down easily and then, from what I can see Netbeans can import multiple projects from an Eclipse workspace (File > Import Project > Eclipse Project). This way you can just remove the old libraries from your Netbeans project and them import them all again from the updated Eclipse workspace.

      PS: I will be making new Google Play Services / Firebase version 10.0.1 and 10.2.0 available soon (heads up cause they raised minSdk to API14 for 10.2.0). They seem to be quite popular so I will continue to build them as long as there is demain for it, so you can keep going using them for as long as you need. Thank you for your comments! :-)

      Delete
  6. Thanks a lot for your job!! I really love Eclipse and thanks to you I'm back on tracks: I've cloned 20 eclipse projects - now I'm up-to-date yiha :)
    Just missing the play-services-gcm one, dunno if you plan to add it... but no worries, in the meanwhile I'll unzip the aar file.
    Thanks again!

    ReplyDelete
    Replies
    1. Wooops just learned about firebase cloud messaging! I must have been in a cave lately, haven't heard about it...

      Delete
    2. You're welcome! Let me look into it, I will try to include it soon in the 10.2.4 release.

      Delete
  7. i tried to import this projectset but i found this message

    The following errors occurred while importing projects. Some projects may not be loaded.
    Projects for repository type org.eclipse.team.svn.core.svnnature could not be loaded as the type could not be found.

    Can you help me?

    ReplyDelete
    Replies
    1. I've added a note on installing Eclipse Subversiv SVN plugin which is required for this, apologies, see note in the post or https://www.youtube.com/watch?v=04L4rkykWZw

      Delete