要配置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應用程序。