본문 바로가기

Language/Java, Android

Flutter: Java uses or overrides a deprecated API

Android / IOS fluter 응용 프로그램에서

auth, firestore firebase를 사용하려는데 빌드 로그에 여러 메시지가 표시됐다.

example)

Note: D:\Flutter\SDK\flutter.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.3+1\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: D:\Flutter\SDK\flutter.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.13.0+1\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. D8: Cannot fit requested classes in a single dex file (# methods: 81454 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html at

 

[Solution]

You need to use the following plugin:dependencies: firebase_auth: ^0.15.3 cloud_firestore: ^0.13.0+1

Don't forget to configure firebase:

https://pub.dev/packages/cloud_firestore#setup

https://pub.dev/packages/firebase_auth#usage

Also in your app/build.gradle, increase the minSdkVersion:

Change this:

minSdkVersion 16

into this:

minSdkVersion 23