Guest User

Flutter building with wrong compileSdkVersion

a guest
Sep 11th, 2024
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | Source Code | 0 0
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. id "dev.flutter.flutter-gradle-plugin"
  5. id "com.google.gms.google-services"
  6. }
  7.  
  8. def localProperties = new Properties()
  9. def localPropertiesFile = rootProject.file('local.properties')
  10. if (localPropertiesFile.exists()) {
  11. localPropertiesFile.withReader('UTF-8') { reader ->
  12. localProperties.load(reader)
  13. }
  14. }
  15.  
  16. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  17. if (flutterVersionCode == null) {
  18. flutterVersionCode = '1'
  19. }
  20.  
  21. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  22. if (flutterVersionName == null) {
  23. flutterVersionName = '1.0'
  24. }
  25.  
  26. def keystorePropertiesFile = rootProject.file("key.properties")
  27. def keystoreProperties = new Properties()
  28. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  29.  
  30. android {
  31. compileSdkVersion 34
  32. ndkVersion flutter.ndkVersion
  33.  
  34. compileOptions {
  35. sourceCompatibility JavaVersion.VERSION_11
  36. targetCompatibility JavaVersion.VERSION_11
  37. }
  38.  
  39. kotlinOptions {
  40. jvmTarget = '11'
  41. }
  42.  
  43. sourceSets {
  44. main.java.srcDirs += 'src/main/kotlin'
  45. }
  46.  
  47. defaultConfig {
  48. applicationId "my.app.id"
  49. minSdkVersion 24
  50. targetSdkVersion flutter.targetSdkVersion
  51. versionCode flutterVersionCode.toInteger()
  52. versionName flutterVersionName
  53. }
  54.  
  55. signingConfigs {
  56. release {
  57. keyAlias keystoreProperties['keyAlias']
  58. keyPassword keystoreProperties['keyPassword']
  59. storeFile file(keystoreProperties['storeFile'])
  60. storePassword keystoreProperties['storePassword']
  61. }
  62. }
  63.  
  64. buildTypes {
  65. release {
  66. signingConfig signingConfigs.release
  67.  
  68. minifyEnabled true
  69. }
  70. }
  71. }
  72.  
  73. flutter {
  74. source '../..'
  75. }
  76.  
  77. dependencies {
  78. implementation platform('com.google.firebase:firebase-bom:30.4.1')
  79. implementation 'com.google.firebase:firebase-analytics-ktx'
  80. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
  81. }
Add Comment
Please, Sign In to add comment