Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find "Sync Project with Gradle Files" button in IntelliJ IDEA

I just added the google-play-services-lib library to my project and am stuck where I need to "sync the project with gradle files", but this button does not exist on IntelliJ 13.0.1. Is there an alternative to this function?

like image 413
Ojonugwa Jude Ochalifu Avatar asked Dec 28 '13 15:12

Ojonugwa Jude Ochalifu


2 Answers

As alternative you can use Refresh all Gradle projects button in Gradle tool window.

I also have not found this button so I made my own :)

  1. Open Gradle tool window with View -> Tool Windows -> Gradle
  2. Start Macro Recording with Edit -> Macros -> Start Recording Macro
  3. In Gradle tool window press Refresh all Gradle projects button
  4. Stop Macro Recording with Edit -> Macros -> Stop Recording Macro
  5. Save Macro with name Gradle sync
  6. Press with right mouse button on IntelliJ IDEA toolbar and choose Customize Menus and Toolbars...
  7. Under Main menu -> Edit -> Macros -> Macro Actions find your Gradle sync Macro, select it and press Edit Action Icon...
  8. Download this icon Sync Project With Gradle Files icon (from documentation http://developer.android.com/google/play-services/setup.html) and select this icon in IDEA dialog window
  9. Now in Menus and Toolbars select last item in Main Toolbar group, press Add After... and select All actions -> Macros -> Gradle sync
  10. Now you have Sync Project with Gradle Files button!
like image 72
mixel Avatar answered Sep 18 '22 14:09

mixel


There is a useful shortcut Ctrl + Shift + A, after which a window appears and you can type some command that you would like IntelliJ to run. Just type "sync" in there and it will find that command Sync Project with Gradle Files, even if it's not visible in the menu.

like image 28
Matt Leonowicz Avatar answered Sep 17 '22 14:09

Matt Leonowicz