Android studiyasida gradening sinxronlashini qo'lda qanday ishlatish kerak?

Men Android Studio dasturidagi Gradle masalalarini diskvalifikatsiya qilyapman va "Sinfni sinxronlashni ishga tushirish" ga murojaat qiling, lekin bu buyruqni qanday ishlatishni bilmayman.

Android studio yoki Mac terminalidan "Gradle sync" ni qanday ishga tushirishim mumkin?

53

7 javoblar

Android studio should have this button in the toolbar marked "Sync project with Gradle Files"

OR by going to Tools -> Android -> Sync Project with Gradle Files from the menubar.

Edit: O'zgarish qachon o'zgarganini bilmayman, lekin hozir shunday ko'rinadi:

enter image description here

82
qo'shib qo'ydi
Adnroid Studio 3.0.1da yo'q
qo'shib qo'ydi muallif Roman M, manba
bir xil xatoga yo'l qo'ydi
qo'shib qo'ydi muallif partho, manba
@RomanM Yo'qotilgani yo'q ... Bu "Fayl" ga ko'chirildi ... Shunday qilib, bu ikonani saqlash uchun yonida
qo'shib qo'ydi muallif W0rmH0le, manba

Keyboard shortcut lovers can add a shortcut for running gradle sync manually by going to File -> Settings -> Keymap -> Plugins -> Android Support -> Sync Project with gradle files (Right click on it to add keyboard shortcut) -> Apply -> OK and you are done. Gradle Sync keyboard shortcutChoose any convenient key as your gradle sync shortcut which doesnot conflict with any other shortcut key, (I have choosen Shift + 5 as my gradle sync key), so next when you want to run gradle sync manually just press this keyboard shortcut key.

20
qo'shib qo'ydi
Mac OS X-da dastlabki ikki qadam uchun "Android Studio-> Preferences"
qo'shib qo'ydi muallif CCJ, manba
+1 savolga eng yaxshi javob
qo'shib qo'ydi muallif nAkhmedov, manba
Eng yaxshi javob, android studiyasining o'xshash belgilaridan Sinxronlashtirish loyihasi ikonini topishga hojat yo'q. Shift + 5 tugmachasini bosing va siz bajarasiz.
qo'shib qo'ydi muallif Er. Kaushik Kajavadara, manba

Ildiz loyihangizda buyruq satri bilan

./ gradlew qurish

Ilovangizni sinxronlashtiradi va quradi

To see all available gradle task, use ./gradlew tasks

18
qo'shib qo'ydi

Android Studio 3.1 da https://stackoverflow.com/a/49576954/2914140 javobiga qarab:

enter image description here

This command is moved to File > Sync Project with Gradle Files.

enter image description here

15
qo'shib qo'ydi
@swooby, xush kelibsiz. Men ham bir muncha vaqt topdim, hatto savol berdim va yordam berishdi.
qo'shib qo'ydi muallif CoolMind, manba
ROFL! Ushbu tugma uchun 2 kun qidiryapman! Rahmat!
qo'shib qo'ydi muallif swooby, manba

I presume it is referring to Tools > Android > "Sync Project with Gradle Files" from the Android Studio main menu.

13
qo'shib qo'ydi
gradle --recompile-scripts

hech narsa qilmasdan sinxronlash kabi ko'rinadi. avtomatik binolarni yoqishingiz mumkin

gradle --recompile-scripts --continuous

Qo'shimcha ma'lumot uchun hujjatlarni ko'rib chiqing:

https://docs.gradle.org/current/userguide/gradle_command_line.html

3
qo'shib qo'ydi

Yorliq (Ubuntu, Windows):

Ctrl + F5

Gradle fayllari bilan loyihani sinxronlash.

2
qo'shib qo'ydi
ubuntu 16.04 android studiyasida ishlamay, 3.0.1
qo'shib qo'ydi muallif Umar Ata, manba
MacOS yorliqlarida aniqlanmagan bo'lsa, uni tayinlash kerak. Quyida tasvirlangan stackoverflow.com/a/29642935/1839096
qo'shib qo'ydi muallif Silwester, manba