2 글 보임 - 1 에서 2 까지 (총 2 중에서)
-
글쓴이글
-
2023년 7월 29일 03:16 #92699
김윤호참가자안녕하세요 어느 순간 갑자기 안드로이드 빌드 오류가 떠서 여쭤봅니다 오류 코드는 다음과 같습니다.
FAILURE: Build failed with an exception.
* Where: Build file '/Users/yunho/Desktop/Programming/flutter/el_sports/android/app/build.gradle' line: 40
* What went wrong: A problem occurred evaluating project ':app'. > Could not find method kotlinOptions() for arguments [build_9xhye33cl16uqbx7yun7xggj9$_run_closure2$_closure6@555f300e] on extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
* Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s Exception: Gradle task assembleDebug failed with exit code 1 그리고 android/app/build.gradle 파일은 다음과 같습니다
def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } }
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.") }
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' }
def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' }
apply plugin: 'com.android.application' // START: FlutterFire Configuration apply plugin: 'com.google.gms.google-services' // END: FlutterFire Configuration //apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
kotlinOptions { jvmTarget = '1.8' }
sourceSets { main.java.srcDirs += 'src/main/kotlin' }
defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.easylife.el_sports" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 23 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName }
buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } }
flutter { source '../..' }
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } 그리고 오류코드의 * Where: Build file '/Users/yunho/Desktop/Programming/flutter/el_sports/android/app/build.gradle' line: 40 40번째 줄은 kotlinOptions { jvmTarget = '1.8' } 이 코드입니다.
구글링도 해보고 stackoverflow에 질문도 해보았지만 해결하지 못하였습니다 어떻게 해결해야될까요?
2023년 7월 29일 09:59 #92711
codingapple키 마스터프로젝트에서 터미널켜서 flutter clean / flutter pub get눌러봅시다 아니면 새로 프로젝트 만들어서 거기로 옮깁시다
-
글쓴이글
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
- 답변은 로그인 후 가능합니다.