droidkaigi2018-flutter
droidkaigi2018-flutter copied to clipboard
Error when flutter run -d
Initializing gradle... 1.2s Resolving dependencies...
- Error running Gradle: Exit code 1 from: /Users/xxx/Documents/GitHub/droidkaigi2018-flutter/android/gradlew app:properties: Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence. java.lang.IllegalStateException: compileSdkVersion is not specified.
FAILURE: Build failed with an exception.
-
Where: Build file '/Users/xxx/Documents/GitHub/droidkaigi2018-flutter/android/app/build.gradle' line: 19
-
What went wrong: A problem occurred evaluating project ':app'.
/Users/xxx/Documents/GitHub/droidkaigi2018-flutter/android/key.properties (No such file or directory)
I faced same error.
The causes that there is not committed key.properties
file which using in generating release build apk.
comment out some lines in android/app/build.gradle
like below then you can build project as debug mode.
android/app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withInputStream { stream ->
localProperties.load(stream)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
//def keystorePropertiesFile = rootProject.file("key.properties")
//def keystoreProperties = new Properties()
//keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.droidkaigi2018"
minSdkVersion 16
targetSdkVersion 25
versionCode 10000
versionName "1.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file(keystoreProperties['storeFile'])
// storePassword keystoreProperties['storePassword']
// }
}
buildTypes {
release {
// Signing with the debug keys for now, so `flutter run --release` works.
// signingConfig signingConfigs.release
}
profile {
matchingFallbacks = ['debug', 'release']
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
Sorry, I will check :eyes: