flyerhq / flutter_link_previewer

Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.
MIT License
72 stars 75 forks source link

No implementation found for method canLaunch(URL can't launch) #34

Closed rvndsngwn closed 2 years ago

rvndsngwn commented 2 years ago
` [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] 
Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7) <asynchronous suspension>
#1      canLaunch (package:url_launcher/url_launcher.dart:132:10) <asynchronous suspension>
#2      _LinkPreviewState._onOpen (package:flutter_link_previewer/src/widgets/link_preview.dart:179:9) <asynchronous suspension>`
demchenkoalex commented 2 years ago

Hey @rvndsngwn I need more information, what is happening exactly? crash, warning?

what platform?

also can you give me flutter doctor -v output

and what version of the flutter_link_previewer are you using?

rvndsngwn commented 2 years ago

Hi.. @demchenkoalex

Crash & Warning info. :- Screenshot 2021-10-11 at 3 44 19 PM

Platform & Device info. :- Redmi Note 4 (mobile) • 1ef50c810304 • android-arm64 • Android 11 (API 30)

flutter doctor -v output :-

arvindsangwan@Arvinds-MacBook-Air chat_screen_flutter % flutter doctor -v 
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.6 20G165 darwin-arm, locale en-IN)
    • Flutter version 2.5.2 at /Users/arvindsangwan/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3595343e20 (11 days ago), 2021-09-30 12:58:18 -0700
    • Engine revision 6ac856380f
    • Dart version 2.14.3

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/arvindsangwan/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.0, Build version 13A233
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.60.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (2 available)
    • Redmi Note 4 (mobile) • 1ef50c810304 • android-arm64  • Android 11 (API 30)
    • Chrome (web)          • chrome       • web-javascript • Google Chrome 94.0.4606.71

• No issues found!
arvindsangwan@Arvinds-MacBook-Air chat_screen_flutter % 

version of the flutter_link_previewer :- Screenshot 2021-10-11 at 3 45 22 PM

Code:- Screenshot 2021-10-11 at 4 07 11 PM

demchenkoalex commented 2 years ago

Thanks, we will look into it

demchenkoalex commented 2 years ago

So the problem was in the url_launcher. See the setup docs for Android, this will help. I have also added

<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
  <intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="https" />
  </intent>
</queries>

to the example and removed throw 'Could not launch $link';

rvndsngwn commented 2 years ago

So the problem was in the url_launcher. See the setup docs for Android, this will help. I have also added

<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
  <intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="https" />
  </intent>
</queries>

to the example and removed throw 'Could not launch $link';

Thank you so much @demchenkoalex