要配置Gradle Android插件,请按照以下步骤进行操作:
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:30.0.2'
implementation 'com.android.support:design:30.0.2'
}
android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
free {
applicationId "com.example.myapp.free"
}
paid {
applicationId "com.example.myapp.paid"
}
}
}
通过以上步骤,您可以成功配置Gradle Android插件并构建您的Android应用程序。