Some input files use or override a deprecated API Flutter

Viewed 3098

I am using sms_autofill: ^1.3.1 plugin from pub.dev
Everything was fine before adding this plugin.
My pubspec.yaml file is as follows

name: example_app
description: A new Flutter project.

publish_to: "none"

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  sms_autofill: ^1.3.1

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

after adding this plugin in blank application while debugging the app following warning is shown

Launching lib\main.dart on Emulator in debug mode...
lib\main.dart:1
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.

flutter -doctor logs are

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.18363.1379], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.53.2)
[√] Connected device (1 available)

• No issues found!

can anyone guide in removing the warning, and how to find a depreciated api used by plugin sms_autofill.

2 Answers

You can do:

flutter upgrade
flutter clean
flutter run

If you have unexpected result when released, add this to your app/build.gradle file:

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'

I had faced same issue, I did those steps.

if you'r using API calling,
Make sure you have the Internet Permission on you android Manifest android\app\src\main\AndroidManifest.xml

<manifest> 
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

if If you're using Shared Preferences plugin ,
In android\build.gradle set your dependencies to use the classpath 'com.android.tools.build:gradle:3.5.1'

dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
...
}

add following lines in android\app\src\main\AndroidManifest.xml manifest

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

and then add these lines in android\app\build.gradle

buildTypes {
 release {
    shrinkResources false
    minifyEnabled false
}}

run this command,

flutter clean
flutter pub get

then debug your app,

flutter run

after stop the debug and building apk using the below commands,

flutter build apk --no-shrink

or

flutter build apk --split-per-abi --no-shrink
Related