9: only buildscript {}, pluginManagement {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed
처음에 flutter 프로젝트를 생성하면 plugin이 {}에 묶여있다.
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
근데 요렇게 하고 key.properties를 가져오는 코드를 넣고 build appbundle을 하면 오류가 발생한다.
해결법은 plugins {} 안의 내용물을 다 바깥으로 뺀 후에 최상단에 놓으면 된다는거다.
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "dev.flutter.flutter-gradle-plugin"
왜인지 누가 좀 알려줘,,,,
'flutter' 카테고리의 다른 글
flutter 앱 개발 소스 분석-3 (0) | 2024.12.12 |
---|---|
flutter 앱 개발 소스 분석-2 (0) | 2024.12.11 |
flutter 앱 개발 소스 분석-1 (1) | 2024.12.11 |
windows에서 안드로이드 개발을 위해 사용했던 flutter 프로젝트가 macOS의 ios 에뮬레이터에서 동작을 안할 때 (0) | 2024.12.08 |
flutter 1일차 (0) | 2024.11.24 |