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

后端 未结 6 1616
太阳男子
太阳男子 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:12

    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.

    0 讨论(0)
  • 2021-02-02 10:22

    The Gradle sync is still there, under Tools -> Android -> Sync with Gradle

    If you don't see it, then Intellij needs to re-link your gradle file.

    Try closing the project, re-opening by File -> Import Project -> and select your .gradle file

    0 讨论(0)
  • 2021-02-02 10:22

    In my Case, One of My plugin, Android support got disabled due to some reason , As soon as I enabled it , and sync it the button automatically showed.

    Go to File > Settings > Plugin > Android support(Tick this).

    and sync your project.

    0 讨论(0)
  • 2021-02-02 10:23

    "Sync Project with Gradle Files" is not present in IntelliJ. However a similar option is available to build all the gradle files together. Go to View --> Tool Windows --> Gradle. A Gradle task panel gets displayed in the right side with the list of apps. Select your app and click the "Refresh all Gradle projects" in the top bar of the Gradle task panel.

    Another method is as mentioned by "Avi Arro"

    0 讨论(0)
  • 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!
    0 讨论(0)
  • 2021-02-02 10:37

    I haven`t seen such option in pure IntelliJ. I guess you are developing some android app. You should then switch to Android Studio (based on IntelliJ) where this option is available for sure.

    http://developer.android.com/sdk/installing/studio.html

    0 讨论(0)
提交回复
热议问题