build.gradle 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. def localProperties = new Properties()
  2. def localPropertiesFile = rootProject.file('local.properties')
  3. if (localPropertiesFile.exists()) {
  4. localPropertiesFile.withInputStream { stream ->
  5. localProperties.load(stream)
  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. apply plugin: 'com.android.application'
  13. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  14. android {
  15. compileSdkVersion 25
  16. buildToolsVersion '25.0.3'
  17. lintOptions {
  18. disable 'InvalidPackage'
  19. }
  20. defaultConfig {
  21. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  22. applicationId "com.yourcompany.flutterstarter"
  23. minSdkVersion 16
  24. targetSdkVersion 25
  25. versionCode 1
  26. versionName "1.0"
  27. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  28. }
  29. buildTypes {
  30. release {
  31. // TODO: Add your own signing config for the release build.
  32. // Signing with the debug keys for now, so `flutter run --release` works.
  33. signingConfig signingConfigs.debug
  34. }
  35. }
  36. }
  37. flutter {
  38. source '../..'
  39. }
  40. dependencies {
  41. androidTestCompile 'com.android.support:support-annotations:25.4.0'
  42. androidTestCompile 'com.android.support.test:runner:0.5'
  43. androidTestCompile 'com.android.support.test:rules:0.5'
  44. }