build.gradle 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
  5. id "dev.flutter.flutter-gradle-plugin"
  6. }
  7. def localProperties = new Properties()
  8. def localPropertiesFile = rootProject.file("local.properties")
  9. if (localPropertiesFile.exists()) {
  10. localPropertiesFile.withReader("UTF-8") { reader ->
  11. localProperties.load(reader)
  12. }
  13. }
  14. def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
  15. if (flutterVersionCode == null) {
  16. flutterVersionCode = "1"
  17. }
  18. def flutterVersionName = localProperties.getProperty("flutter.versionName")
  19. if (flutterVersionName == null) {
  20. flutterVersionName = "1.0"
  21. }
  22. android {
  23. namespace = "com.example.crab_ui"
  24. compileSdk = flutter.compileSdkVersion
  25. ndkVersion = flutter.ndkVersion
  26. compileOptions {
  27. sourceCompatibility = JavaVersion.VERSION_1_8
  28. targetCompatibility = JavaVersion.VERSION_1_8
  29. }
  30. defaultConfig {
  31. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  32. applicationId = "com.example.crab_ui"
  33. // You can update the following values to match your application needs.
  34. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
  35. minSdk = flutter.minSdkVersion
  36. targetSdk = flutter.targetSdkVersion
  37. versionCode = flutterVersionCode.toInteger()
  38. versionName = flutterVersionName
  39. }
  40. buildTypes {
  41. release {
  42. // TODO: Add your own signing config for the release build.
  43. // Signing with the debug keys for now, so `flutter run --release` works.
  44. signingConfig = signingConfigs.debug
  45. }
  46. }
  47. }
  48. flutter {
  49. source = "../.."
  50. }