Create Config.gradle
Ext { android = [ compilesdkversion : buildtoolsversion : "26.0.2", minsdkversion : Targetsdkversion, versioncode: 1, versionname : "1.0", Androidsupportversion: "26.1.0", ] dependencies = [ "Annotations" : "Com.android.support: support-annotations:${android["Androidsupportversion"]} ", " Appcompat-v7 " :" Com.android.support: appcompat-v7:${android["Androidsupportversion"]} ", " Design " :" com.android.support:design:${android[" Androidsupportversion "]}", ]}
Use
Project--gradle
Apply from: "Config.gradle"
App--gradle
defaultconfig { ApplicationID "Com.example.ma.demo" minsdkversion rootproject.ext.android["Minsdkversion" ] targetsdkversion rootproject.ext.android["targetsdkversion"] versioncode 1 versionname "1.0 " Testinstrumentationrunner "Android.support.test.runner.AndroidJUnitRunner" }
dependencies { Implementation filetree (include: [' *.jar '], dir: ' Libs ') implementation rootproject.ext.dependencies["Appcompat-v7"]
}
Android Studio Gradle Unified managed version