• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Flutter 게시판 안드로이드 빌드 오류

안드로이드 빌드 오류

  • 이 주제에는 1개 답변, 2명 참여가 있으며 codingapple2 년 전에 전에 마지막으로 업데이트했습니다.
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 글쓴이
  • #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에 질문도 해보았지만 해결하지 못하였습니다
    어떻게 해결해야될까요?
    
    
    #92711

    codingapple
    키 마스터
    프로젝트에서 터미널켜서 flutter clean / flutter pub get눌러봅시다 
    아니면 새로 프로젝트 만들어서 거기로 옮깁시다
2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관, 개인정보처리방침
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠