简体   繁体   中英

Android studio new activity template add same dependencies already defined in gradle file when use Kotlin DSL?

When I use new empty activity template android studio it auto adds two line dependencies in my app build.gradle.kts and resync the project.

implementation(Config.Libs.appCompat)
implementation(Config.Libs.constraintLayout)

implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'

Seems like android studio cannot detect defined dependencies when use with Kotlin DSL. Anyone know how to slove this?

Yes, now you should manually remove unnecessary dependencies from your .gradle files, moreover you store your project dependencies in support files outside the .gradle files so the Android Studio's system cannot recognize the fact that dependencies have already added in the project.

Maybe in future it'll be added in IDE but now you should manage your dependencies' files by yourself.

Happy coding!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM