We all know that the Android version statement is in the Androidmanifest.xml file. For example
<xmlns:android= "http://schemas.android.com/apk/res/android"package = "Com.xcode.lockcapture" android:versioncode= "2" android: Versionname= "1.1">
In Android Studio, Gradle is used to compile and manage a variety of miscellaneous things, including version management.
So the problem comes, when both versions declare androidmanifest and Gradle conflict,the priority of the Gradle is the highest
This leads to androidmanifest no matter how the change, the end result is not working. because when creating an Android Studio project, the IDE has been very thoughtful to help us set the version number in Gradle.
Final Solution
Both versions affirm that you can choose one of them.
PS: According to Google so thoughtful to help us to migrate some of the chores to Gradle, we recommend the use of Gradle management.
Android Studio version modified Invalid solution