Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url_launcher 5.1.2 warning on build #37616

Closed
kjeremy opened this issue Aug 5, 2019 · 115 comments
Closed

url_launcher 5.1.2 warning on build #37616

kjeremy opened this issue Aug 5, 2019 · 115 comments
Assignees
Labels
a: annoyance Repeatedly frustrating issues with non-experimental functionality customer: crowd Affects or could affect many people, though not necessarily a specific customer. dependency: android Android team may need to help us p: url_launcher Plugin to launch external applications package flutter/packages repository. See also p: labels.

Comments

@kjeremy
Copy link

kjeremy commented Aug 5, 2019

Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.1.2\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
@siyasangab
Copy link

siyasangab commented Aug 5, 2019

I have the same issue

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.1.2\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
D8: Program type already present: android.support.v4.media.MediaBrowserCompat$ItemReceiver

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForRelease'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:

@BenBao93
Copy link

BenBao93 commented Aug 6, 2019

I am experiencing the same issue, however the project still runs and the package does function for me despite the build error.

@janosdupai
Copy link

Same issue. Is there any solution?

@Fernandomr88
Copy link

Same issue.

My guess is because that file here overrides this:

public boolean shouldOverrideUrlLoading(WebView view, String url)

and as said here from API 24 to now you should use

public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request)

but since flutter wants to support both before and after API 24, they use both overrides, so...
but that's just a guess.

@avvari-da
Copy link

Same issue here:

/Users/dheeraj2dj/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.1.2/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java:42: warning: [deprecation] shouldOverrideUrlLoading(WebView,String) in WebViewClient has been deprecated
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
                       ^
/Users/dheeraj2dj/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.1.2/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java:47: warning: [deprecation] shouldOverrideUrlLoading(WebView,String) in WebViewClient has been deprecated
          return super.shouldOverrideUrlLoading(view, url);
                      ^
2 warnings

@henriquearthur
Copy link

Same issue.
url_launcher: ^5.1.2

Note: /opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.1.2/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

@kjeremy maybe edit this issue with default issues template? Steps to reproduce, logs, doctor, etc

@debasiskoley
Copy link

debasiskoley commented Aug 27, 2019

Same issue with flutter run --release

url_launcher-5.1.2/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java uses or overrides a deprecated API.

@01xJoao
Copy link

01xJoao commented Aug 30, 2019

I'm having the same issue.

@Xgamefactory
Copy link

flutter tech team on vacation i guess )

@BondarenkoStas BondarenkoStas added customer: crowd Affects or could affect many people, though not necessarily a specific customer. plugin labels Sep 5, 2019
@shaxxx
Copy link

shaxxx commented Sep 6, 2019

Same issue

1 similar comment
@jing-pei
Copy link

jing-pei commented Sep 10, 2019

Same issue

@fauzipadlaw
Copy link

same issue

@antoninobajeli
Copy link

Same issue

@Katekko
Copy link

Katekko commented Sep 11, 2019

Same here

@rfitz123
Copy link

Same issue. Maybe flutter team should be looking at this??

@oriewancu
Copy link

Same issue

1 similar comment
@thanhhuan1990
Copy link

Same issue

@verma-arun
Copy link

is there any solution for this or I also have to write "the SAME ISSUE"

@MuhammadAliKhan1
Copy link

same issue

1 similar comment
@crnaosa
Copy link

crnaosa commented Sep 15, 2019

same issue

@ericklanford
Copy link

Use url_launcher: ^5.1.3

@Fernandomr88
Copy link

Use url_launcher: ^5.1.3

Note: c:\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.1.3\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

@jsgalarraga
Copy link

In the app level build.gradle update your androidX dependencies, for me worked changing to this versions

dependencies {
    ...
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

My minSdkVersion is 19 so don't know if needed to update to 23

@RyanRamchandar
Copy link

@jsgalarraga this did not resolve it for me.

@Syaba999
Copy link

same issue

@hygornet
Copy link

Poxa, até hoje... Estou com problemas na 5.5.0.
Até quando flutter? :(

@guicostadev
Copy link

Poxa, até hoje... Estou com problemas na 5.5.0.
Até quando flutter? :(

Aqui também.. aguardando atualização...

@Xatta-Trone
Copy link

still persists....

@uknowmeright
Copy link

updating to 5.5.0 fixed the issue for me

@candreotti
Copy link

Same issue here with version 5.5.0... any news regarding a possible fix?

@angelocapone
Copy link

Same issue for me with version 5.5.0.
Any reason why can't be fixed?

@yourshinsuke
Copy link

yourshinsuke commented Aug 20, 2020

@angelocapone
I also use 5.5.0, same Issue.

WebViewActivity.java is deprecated too
when fix it?
Android and Flutter are developed by Google? isn't it?

@dijalmasilva
Copy link

Same issue for me with version 5.5.0.

@kanaydo
Copy link

kanaydo commented Aug 25, 2020

same issue with version 5.5.0, the app is fine, but the error message still there.
try to change targetSdkVersion to 29, the error message gone on debug, but still show when build release.

@rismandev
Copy link

rismandev commented Aug 26, 2020

Hi, I just Explore this issue,

I have issue when running or release with flutter build apk command.

/Users/mac/.pub-cache\hosted\pub.dartlang.org\url_launcher-5.5.0\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.

  1. open app/build.gradle file, Change minSdkVersion 21 or higher.
  2. Open file .pub-cache\hosted\pub.dartlang.org\url_launcher-5.5.0\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java then you can see this code :
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    view.loadUrl(url);
    return false;
  }
  return super.shouldOverrideUrlLoading(view, url);
}

@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    view.loadUrl(request.getUrl().toString());
  }
  return false;
}

Delete and change with this code :

@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    view.loadUrl(request.getUrl().toString());
    return false;
  }
  return super.shouldOverrideUrlLoading(view, request);
}
  1. clean build with flutter clean command & try running again.

@yourshinsuke
Copy link

.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.2/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java

@yourshinsuke
Copy link

flutter.dev is not official google team?
Why they can't resolve though Google, Flutter and Android is Google official product.

@tony123S
Copy link

tony123S commented Sep 3, 2020

I facing this issue few days ago. I got error

/home/xxx/Desktop/flutter_linux_1.20.2-stable/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.5.2/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java uses or overrides a deprecated API.

I keep looking on this error and try to fix but to no avail. Then I look for another error line which is

A problem occurred configuring root project 'connectivity'.

After I upgraded the connectivity plugin to the latest version, the error gone.

I would suggest you to look again the error, maybe the error is caused by other issue?

@faisalmushtaq007
Copy link

flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Isnt there any solution till date????

@Abhijithsp
Copy link

No not yet,but it just warning,nothing much,i have been using this package in my 3 projects for 6+ months still no problems,it works perfectly fine @faisalmushtaq007

@giorgio79
Copy link

giorgio79 commented Oct 9, 2020

It is not just a warning. My build fails:

[+168746 ms] Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.7.2\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
[   +2 ms] Note: Recompile with -Xlint:deprecation for details.
[+7163 ms] Note: Some input files use unchecked or unsafe operations.
[        ] Note: Recompile with -Xlint:unchecked for details.
[+14500 ms] warning: [options] source value 1.3 is obsolete and will be removed in a future release
[   +1 ms] warning: [options] target value 1.3 is obsolete and will be removed in a future release
[        ] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[ +403 ms] C:\Users\....\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:14: error: annotations are not supported in -source 1.3

Possibly an issue with Kotlin? https://stackoverflow.com/questions/52567791/use-annotation-processor-in-kotlin

line 14 in GeneratedPluginRegistrant.java is a simple "@ Keep" comment

...
/**
 * Generated file. Do not edit.
 * This file is generated by the Flutter tool based on the
 * plugins that support the Android platform.
 */
@Keep
public final class GeneratedPluginRegistrant {
  public static void registerWith(@NonNull FlutterEngine flutterEngine) {
    ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);

This solved it for me https://stackoverflow.com/questions/56621169/android-error-annotations-are-not-supported-in-source-1-3

@pedromassangocode
Copy link

pedromassangocode commented Oct 23, 2020

Hi @mvanbeusekom @amirh
Can you plea confirm that this was fixed by flutter/plugins#3008?

Edit:

Just tried it myself and I can confirm that the issue does not exist on the latest version of the package.

Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...
I/flutter_exampl( 2832): Not late-enabling -Xcheck:jni (already on)
I/flutter_exampl( 2832): Unquickening 12 vdex files!
W/flutter_exampl( 2832): Unexpected CPU variant for X86 using defaults: x86
W/flutter_exampl( 2832): Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (greylist,test-api, reflection, allowed)
W/flutter_exampl( 2832): Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (greylist, reflection, allowed)
W/flutter_exampl( 2832): Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (greylist, reflection, allowed)
W/flutter_exampl( 2832): Accessing hidden method Landroid/util/LongArray;->get(I)J (greylist, reflection, allowed)
I/flutter_exampl( 2832): NativeAlloc concurrent copying GC freed 2266(204KB) AllocSpace objects, 3(60KB) LOS objects, 49% free, 1914KB/3828KB, paused 112us total 1.428s
Waiting for sdk gphone x86 arm to report its views...
Debug service listening on ws://127.0.0.1:60210/2fBQBTAgF7g=/ws
Syncing files to device sdk gphone x86 arm...
I/Choreographer( 2832): Skipped 272 frames!  The application may be doing too much work on its main thread.
I/Choreographer( 2832): Skipped 54 frames!  The application may be doing too much work on its main thread.

For anyone facing a similar issue, please file a new issue by providing the information requested in the template.

@mvanbeusekom
Copy link

@pedromassangocode I can also confirm. The error reported by @giorgio79 was unrelated.

Interesting to note is that after pr flutter/plugins#3008 was merged, pr flutter/plugins#2991 landed which reintroduced the deprecation warning which was fixed again in flutter/plugins#3132.

So in the end the issue is fixed ;)

@muhjamie
Copy link

muhjamie commented Nov 6, 2020

In the app level build.gradle update your androidX dependencies, for me worked changing to this versions

dependencies {
    ...
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

My minSdkVersion is 19 so don't know if needed to update to 23

This fixed the error for me, my minSdkVersion is 21

@sohanoor
Copy link

I am using 'url_launcher: ^5.7.10'
minSdkVersion is 23
maxSdkVersion is 30

still launcher is not working

@mvanbeusekom
Copy link

@sohanoor, this issue was related to a warning showing in the output when compiling the Flutter app. Normally this doesn't cause any problems, however some development teams treat warnings as errors and therefore cannot compile their application.

If you are getting an error while using the url_launcher plugin please open a new issue and provide al the requested information so we can help you solve the problem.

@eqrakhattak
Copy link

In your pubspec.yaml update the dependency to the latest version of url_launcher
you can find it at https://pub.dev/packages/url_launcher
Click on pub get and run the project again

@github-actions
Copy link

github-actions bot commented Aug 4, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: annoyance Repeatedly frustrating issues with non-experimental functionality customer: crowd Affects or could affect many people, though not necessarily a specific customer. dependency: android Android team may need to help us p: url_launcher Plugin to launch external applications package flutter/packages repository. See also p: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.