flutter-오류

🚨cloud_firestore 추가 후 오류 발생

💻Flutter, pubspec.yaml 파일에 cloud_firestore

  • 플러터에서 cloud_firestore 추가 했습니다. 빌드 후 앱 실행하니, 오류가 발생합니다.
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^5.6.7

🚨오류 내용

  • cloud_firestore는 Android NDK(Native Development Kit)가 필수라는 내용입니다.
Your project is configured with Android NDK 26.3.11579264, but the following plugin(s) depend on a different Android NDK version:
- cloud_firestore requires Android NDK 27.0.12077973
- firebase_core requires Android NDK 27.0.12077973
Fix this issue by using the highest Android NDK version (they are backward compatible).
Add the following to C:\dev\workspace_android_test\chapter10\android\app\build.gradle.kts:

    android {
        ndkVersion = "27.0.12077973"
        ...
    }

🛠️해결책

  • app\build.gradle.kts 파일에서 ndkVersion = flutter.ndkVersion 주석 처리하고, ndkVersion = "27.0.12077973" 문구를 추가 후에 빌드 진행합니다.
android {
    namespace = "com.example.chapter10"
    compileSdk = flutter.compileSdkVersion
	// ndkVersion = flutter.ndkVersion // 삭제하거나 주석처리
    ndkVersion = "27.0.12077973" // 추가되는 부분
}

'⚠️오류' 카테고리의 다른 글

🚨 /var/run/docker.sock 권한 문제  (2) 2025.05.02

+ Recent posts