flutter_webview_plugin icon indicating copy to clipboard operation
flutter_webview_plugin copied to clipboard

Some input files use or override a deprecated API on WebviewManager.java

Open Dn-a opened this issue 7 years ago • 30 comments

hi guys, when run project on android studio, i have this result:

Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\NINU0\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.0+2\android\src\main\java\com\flutter_webview_plugin\WebviewManager.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Dn-a avatar Nov 22 '18 12:11 Dn-a

I also see the same in PowerShell logs after I Do Flutter run.

MichaelSowah avatar Nov 24 '18 02:11 MichaelSowah

I think that's because of two different clients (webview changed between android versions). Code checks what android version it's using but I think we should add some link rule to the method.

Anyway it should be fine to use it as it is, feel free to make PR for it

charafau avatar Nov 26 '18 01:11 charafau

@charafau am on android 9

MichaelSowah avatar Nov 26 '18 07:11 MichaelSowah

@Dn-a Did you solve the problem?

MeshkaniMohammad avatar Feb 28 '19 11:02 MeshkaniMohammad

@MeshkaniMohammad lately I have not used the plugin

Dn-a avatar Feb 28 '19 15:02 Dn-a

Caught this error recently while building apk. Console output:

Initializing gradle...                                              2.5s
Resolving dependencies...                                          19.4s
Note: Some input files use or override a deprecated API.                
Note: Recompile with -Xlint:deprecation for details.                    
Note: /Users/vanelizarov/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.3.1/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                     115.1s
Built build/app/outputs/apk/release/app-release.apk (8.8MB).

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.3.13, on Mac OS X 10.14.4 18E220a, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.32.1)
[✓] Connected device (1 available)

vanelizarov avatar Mar 21 '19 11:03 vanelizarov

@vanelizarov I think it's a warning! because you built your apk successfully.

MeshkaniMohammad avatar Apr 15 '19 19:04 MeshkaniMohammad

Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 108.5s Gradle task assembleRelease failed with exit code 1

pmrajani avatar May 06 '19 07:05 pmrajani

Flutter fails to build an apk using flutter build apk and logs this output:

Resolving dependencies... 1.8s Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 44.5s Gradle task assembleRelease failed with exit code 1

While if I make a release build if I open the android folder, the apk is built successfully. I am using a webview in my application if that makes any difference.

DhruvamSharma avatar Jul 11 '19 06:07 DhruvamSharma

I have the same problem with many other plugins. Did someone found a solution already?

Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.9+5\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.9+5\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity-0.4.5\android\src\main\java\io\flutter\plugins\connectivity\ConnectivityBroadcastReceiver.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.2.0\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

LauDijksterhuis avatar Oct 16 '19 06:10 LauDijksterhuis

Hi Guys, I'm also facing same issue:

Note: /Users/muhammadmateen/Library/flutter-sdk/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.3.8/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 106.2s Gradle task assembleRelease failed with exit code 1

muhammadmateen027 avatar Oct 16 '19 10:10 muhammadmateen027

@charafau facing the same issue. 1 year and still no solutions?

Nisthar avatar Oct 29 '19 06:10 Nisthar

Hello guys, i had the same problem with url_luncher after i moved with webview instead the same error appears

Any news?

ofahd avatar Nov 20 '19 20:11 ofahd

any update guys?? I am also facing the same issue :(

amittttt avatar Dec 31 '19 09:12 amittttt

Still no updates?

AdmiralYuuShi avatar Jan 31 '20 13:01 AdmiralYuuShi

I had the problem but changed the minSDKVersion to 23 in the app build.gradle and it worked

Dx avatar Mar 01 '20 00:03 Dx

I still have the same problem

SaddamAlwheeb avatar Mar 08 '20 18:03 SaddamAlwheeb

It's just a warning to support older android versions, guess I can add annotation for linter not to mention it.

charafau avatar Mar 10 '20 18:03 charafau

hey guys, I'm no professional programmer, I did face the problem during compiling the code. and I found a solution

just change the lunching activity in the manifest file and rebuild the project and then again change the lunching activity to the default one. it worked for me hope it will work for you guys and if you want to identify the problem try this code in build.gradle(project)

allprojects { repositories { google() jcenter()

}

gradle.projectsEvaluated { tasks.withType(JavaCompile){ options.compilerArgs << "-Xlint:deprecation" } } }

khanrajesh avatar Mar 24 '20 14:03 khanrajesh

I'm having the same issue with "url_launcher" package.

ramtinq avatar Apr 09 '20 08:04 ramtinq

same issue with ''clipboard_manager" package.

skanderhamdi avatar Apr 24 '20 00:04 skanderhamdi

I'm having the same issue with "url_launcher" package.

try url_launcher: ^4.2.0

aquarink avatar Apr 27 '20 06:04 aquarink

I solved the issue by add android:usesCleartextTraffic="true" to file path android/app/src/main/AndroidManifest.xml it should look like this:

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="app_name"
        android:icon="@mipmap/ic_launcher"
        android:usesCleartextTraffic="true">

chinnpao avatar May 02 '20 16:05 chinnpao

I solved the issue by add android:usesCleartextTraffic="true" to file path android/app/src/main/AndroidManifest.xml it should look like this:

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="app_name"
        android:icon="@mipmap/ic_launcher"
        android:usesCleartextTraffic="true">

great, it works for me.

magictomagic avatar May 08 '20 01:05 magictomagic

use minSDKVersion 23 , in the app build.gradle it's work fine!

dubeyram avatar Jul 23 '20 06:07 dubeyram

For me what worked in my instance was generating and inserting a new Maps API Key

Now waiting ion the "Running gradle task 'assembledebug'"

Fingers crossed that it won't return error!

clearnetinc avatar Oct 01 '20 11:10 clearnetinc

Flutter fails to build an apk using flutter build apk and logs this output:

Resolving dependencies... 1.8s Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 44.5s Gradle task assembleRelease failed with exit code 1

While if I make a release build if I open the android folder, the apk is built successfully. I am using a webview in my application if that makes any difference.

you find the solution ?

KenilJasani avatar Nov 03 '20 09:11 KenilJasani

try this: add below code in Android/app/build.gradle file

configurations { compile.exclude group: 'com.google.zxing' }

mshamsi502 avatar Nov 05 '20 08:11 mshamsi502

Those warning messages are coming from the packages that you use inside your flutter project. As long as those dependencies be as same, you can't get rid of them.

https://www.nuomiphp.com/eplan/en/89136.html

AdelDaniel avatar Nov 18 '20 11:11 AdelDaniel

Hello guys, i had the same problem with url_luncher after i moved with webview instead the same error appears

Any news?

same problem here

kenyc838 avatar Mar 30 '22 15:03 kenyc838