build.gradle 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. id "dev.flutter.flutter-gradle-plugin"
  5. }
  6. def localProperties = new Properties()
  7. def localPropertiesFile = rootProject.file('local.properties')
  8. if (localPropertiesFile.exists()) {
  9. localPropertiesFile.withReader('UTF-8') { reader ->
  10. localProperties.load(reader)
  11. }
  12. }
  13. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  14. if (flutterVersionCode == null) {
  15. flutterVersionCode = '1'
  16. }
  17. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  18. if (flutterVersionName == null) {
  19. flutterVersionName = '1.0'
  20. }
  21. android {
  22. namespace "io.github.jianboy.flutter.flutter_paydemo"
  23. // stripe_android / url_launcher_android 等插件要求 SDK 35
  24. compileSdkVersion 35
  25. ndkVersion flutter.ndkVersion
  26. compileOptions {
  27. sourceCompatibility JavaVersion.VERSION_17
  28. targetCompatibility JavaVersion.VERSION_17
  29. }
  30. kotlinOptions {
  31. jvmTarget = '17'
  32. }
  33. buildFeatures {
  34. viewBinding true
  35. }
  36. defaultConfig {
  37. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  38. applicationId "io.github.jianboy.flutter.flutter_paydemo"
  39. // You can update the following values to match your application needs.
  40. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
  41. minSdkVersion flutter.minSdkVersion
  42. targetSdkVersion 35
  43. versionCode flutterVersionCode.toInteger()
  44. versionName flutterVersionName
  45. }
  46. buildTypes {
  47. release {
  48. // TODO: Add your own signing config for the release build.
  49. // Signing with the debug keys for now, so `flutter run --release` works.
  50. signingConfig signingConfigs.debug
  51. }
  52. }
  53. }
  54. flutter {
  55. source '../..'
  56. }