기록중

flutter version 3.16.0 update gradle chage android setting

lian_is_clone 2023. 12. 31. 16:04

You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

 

 

Deprecated imperative apply of Flutter's Gradle plugins

How to migrate your Android app's Gradle build files to the new, declarative format.

docs.flutter.dev

 

알고싶다... 처리하고 싶다... 어떻게 해야되는지 모르겠다... 그래도 쓰고 어플리케이션 버전은 어떻게 쓰며  코틀린버전은 어떻게 쓸지 가르켜줭 ㅠㅠ

 

새로만든 프로젝트를 따와 셋팅이랑 그레들 변경 

 

이제 실행은 되었다 그러나...

 

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(null-error, Host platform returned null value for non-null return value., null, null)

 #0      FirebaseCoreHostApi.optionsFromResource (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:248:7)
E/flutter (28139): <asynchronous suspension>
E/flutter (28139): #1      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:89:25)
E/flutter (28139): <asynchronous suspension>
E/flutter (28139): #2      Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:31)
E/flutter (28139): <asynchronous suspension>
E/flutter (28139): #3      PushNotificationConfig2.init (package:peterslab_mobile2/config/push_notification_config2.dart:21:5)
E/flutter (28139): <asynchronous suspension>
E/flutter (28139): #4      main (package:peterslab_mobile2/main.dart:25:3)
E/flutter (28139): <asynchronous suspension>

 파이어베이스 에러인것 같다.

 

google 에러인것같다  setting.gradle 파일에서 

plugins {
    ...
    id 'com.google.gms.google-services' version "4.4.0" apply false
}

이것을 추가하고 

app/build.gradle 에 수정

 

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

추가 

 작동 

 

에러 

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Failed to transform arm64_v8a_debug-1.0.0-cee9e9e26315f258f40562cc9e3e27d4b305df7f.jar (io.flutter:arm64_v8a_debug:1.0.0-cee9e9e26315f258f40562cc9e3e27d4b305df7f) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Execution failed for JetifyTransform: /Users/jongseonglee/.gradle/caches/modules-2/files-2.1/io.flutter/arm64_v8a_debug/1.0.0-cee9e9e26315f258f40562cc9e3e27d4b305df7f/1741634d14a064e1cc3fcb2480654381ef233e3b/arm64_v8a_debug-1.0.0-cee9e9e26315f258f40562cc9e3e27d4b305df7f.jar.
         > Java heap space

* 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 33s
Error: Gradle task assembleDebug failed with exit code 1

 

 

코틀린 안드로이드 버전이 상위버전이여서 이전버전으로 되돌리니 

 

다시 전 파이어베이스 에러 다시 떻다...

 

알고보니 파이어베이스 버전을 이전버전으로 안써서 그랬던것 같다... 버전을 변경하니 잘된다.

 

하......ㅠㅠ