커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
파이어 베이스 설정과정에서 나는 에러
[왕초보] 플러터(Flutter)로 시작하는 앱개발 종합반
4주차
북마크
김*희
댓글
11
추천
0
조회수
15
조회수
15
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


파이어 베이스 설정과정을 진행하다가 에러가 나서 이것 저것 수정하다 아래와 같은 에러를 해결 못하고 있습니다. ㅜㅜ






작성한 코드 및 에러 메세지

에러 메시지

aunching lib/main.dart on sdk gphone64 x86 64 in debug mode...

e: file:///Users/user/Desktop/workspace/thread_app_sample/android/app/src/main/kotlin/com/example/thread_app_sample/MainActivity.kt:3:8 Unresolved reference 'io'.

e: file:///Users/user/Desktop/workspace/thread_app_sample/android/app/src/main/kotlin/com/example/thread_app_sample/MainActivity.kt:5:22 Unresolved reference 'FlutterActivity'.


FAILURE: Build failed with an exception.


* What went wrong:

Execution failed for task ':app:compileDebugKotlin'.

> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction

> Compilation error. See log for more details


* 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 38s

Error: Gradle task assembleDebug failed with exit code 1


아래는 소스 코드 입니다

android/build.gradle.kts

allprojects {

  repositories {

    google()

    mavenCentral()

  }

}




val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()

rootProject.layout.buildDirectory.value(newBuildDir)




subprojects {

  val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)

  project.layout.buildDirectory.value(newSubprojectBuildDir)

}

subprojects {

  project.evaluationDependsOn(":app")

}




tasks.register<Delete>("clean") {

  delete(rootProject.layout.buildDirectory)

}

android/app /buid.gradle.kts

plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("dev.flutter.flutter-gradle-plugin") 
    id("com.google.gms.google-services")
}


android {
    namespace = "com.example.thread_app_sample"
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion


    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }


    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_11.toString()
    }


    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId = "com.example.thread_app_sample"
        // You can update the following values to match your application needs.
        // For more information, see: https://flutter.dev/to/review-gradle-config.
        minSdk = flutter.minSdkVersion
        targetSdk = flutter.targetSdkVersion
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }


    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.getByName("debug")
        }
    }
}


flutter {
    source = "../.."
}


dependencies {
    implementation(platform("com.google.firebase:firebase-bom:33.10.0")) 
    implementation("com.google.firebase:firebase-analytics-ktx")
}


android/gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

android/settings.gradle.kts

pluginManagement {
    val flutterSdkPath = run {
        val properties = java.util.Properties()
        file("local.properties").inputStream().use { properties.load(it) }
        val flutterSdkPath = properties.getProperty("flutter.sdk")
        require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
        flutterSdkPath
    }


    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")


    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
    
    plugins {
    id("dev.flutter.flutter-plugin-loader") version "1.0.0"
    id("com.android.application") version "8.7.0" apply false
    id("org.jetbrains.kotlin.android") version "2.1.0" apply false
    id("com.google.gms.google-services") version "4.4.2" apply false
    }


}








include(":app")


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴