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

后端 未结 6 1618
太阳男子
太阳男子 2021-02-02 10:02

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

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 10:33

    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!

提交回复
热议问题