build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. def localProperties = new Properties()
  2. def localPropertiesFile = rootProject.file('local.properties')
  3. if (localPropertiesFile.exists()) {
  4. localPropertiesFile.withReader('UTF-8') { reader ->
  5. localProperties.load(reader)
  6. }
  7. }
  8. def flutterRoot = localProperties.getProperty('flutter.sdk')
  9. if (flutterRoot == null) {
  10. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  11. }
  12. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  13. if (flutterVersionCode == null) {
  14. flutterVersionCode = '1'
  15. }
  16. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  17. if (flutterVersionName == null) {
  18. flutterVersionName = '1.0'
  19. }
  20. apply plugin: 'com.android.application'
  21. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  22. android {
  23. signingConfigs {
  24. config1 {
  25. keyAlias 'run'
  26. keyPassword '123456'
  27. storeFile file("${project.rootDir}/example-key.jks")
  28. storePassword '123456'
  29. }
  30. }
  31. compileSdkVersion 28
  32. lintOptions {
  33. disable 'InvalidPackage'
  34. }
  35. defaultConfig {
  36. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  37. applicationId "com.example.ijkplayer_example"
  38. minSdkVersion 16
  39. targetSdkVersion 28
  40. versionCode flutterVersionCode.toInteger()
  41. versionName flutterVersionName
  42. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  43. }
  44. buildTypes {
  45. release {
  46. // TODO: Add your own signing config for the release build.
  47. // Signing with the debug keys for now, so `flutter run --release` works.
  48. signingConfig signingConfigs.config1
  49. }
  50. debug {
  51. signingConfig signingConfigs.config1
  52. }
  53. }
  54. }
  55. flutter {
  56. source '../..'
  57. }
  58. dependencies {
  59. // testImplementation 'junit:junit:4.12'
  60. // androidTestImplementation 'com.android.support.test:runner:1.0.2'
  61. // androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  62. }