Cov txheej txheem:

Yuav ua li cas tshem tawm Androidx kev vam meej?
Yuav ua li cas tshem tawm Androidx kev vam meej?

Video: Yuav ua li cas tshem tawm Androidx kev vam meej?

Video: Yuav ua li cas tshem tawm Androidx kev vam meej?
Video: Tsis Muaj Peev Xwm Yuav Ua Li Cas 2024, Kaum ib hlis
Anonim

Koj tuaj yeem mus rau Cov Ntaub Ntawv -> Project Structure -> Modules -> Kev vam meej thiab tshem tawm ib yam kev vam khom graphically, los yog koj ua tau xwb tshem tawm nws form build. gradle cov ntaub ntawv. Yog tias koj qhov project yog siv lub kev vam khom , koj tam sim no tshem tawm , koj yuav tau hloov kho qhov ntawd thiab tshem tawm tej ntaub ntawv rau cov kev vam khom ua ntej lub tsev.

Xav txog qhov no, kuv yuav rov qab mus rau AndroidX li cas?

3 Teb

  1. Tshem tawm cov kab hauv qab no hauv gradle.properties: android. enableJetifier = tseeb android.
  2. Tshem tawm AndroidX kev vam meej hauv kev tsim.
  3. Sync Project nrog Gradle Files.
  4. Tom qab syncing koj yuav muaj ntshuam yuam kev hauv java cov ntaub ntawv, koj tuaj yeem tshem tawm cov khoom siv hauv androidx thiab rov ntxiv qhov sib npaug uas tsis yog androidx imports.

Ib sab saum toj no, AndroidX * artifacts yog dab tsi? Cov khoom qub nyob rau hauv lub hauv androidx namespace suav nrog Android Jetpack cov tsev qiv ntawv. AndroidX yog ib qho kev txhim kho loj rau qhov qub Android Txhawb Lub Tsev Qiv Ntawv, uas tsis tau khaws cia lawm. hauv androidx cov pob khoom hloov pauv Cov Tsev Qiv Ntawv Txhawb Nqa los ntawm kev muab cov khoom sib xws thiab cov tsev qiv ntawv tshiab.

Ib yam li ntawd, koj yuav kho qhov kev txiav txim siab li cas?

Tab sis nws yog ib qho yooj yim los kho yog tias koj ua raws li cov lus qhia hauv qab no

  1. Ob npaug nias rau qhov project tsim. gradle cov ntaub ntawv nyob rau hauv sab laug vaj huam sib luag.
  2. Hloov cov tsev qiv ntawv nyob ntawm qhov chaw nyob ntawm v7: 26.1. 0 ua 7:27.1. 1 raws li cov lus yuam kev tau hais.
  3. Tam sim no nyem Tsim -> Rebuild Project cov ntawv qhia zaub mov hauv android studio sab saum toj cov ntawv qhia zaub mov bar, qhov yuam kev ploj.

Kuv puas yuav tsum tsiv mus rau AndroidX?

Hauv Android Studio 3.2 (Lub Cuaj Hli 2018), muaj kev xaiv ncaj qha rau tsiv teb tsaws uas twb muaj lawm qhov project rau AndroidX . Qhov no refactor tag nrho cov pob tau txais. Ua ntej koj tsiv teb tsaws , nws yog xav kom backup koj qhov project.

Pom zoo: