Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher) - flutter-plugin

Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
I am getting this error while using any plugin. The above error is from using url_launcher. I also get similar error using image_picker.
Here's my pubspec.yml dependency list
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
flutter_facebook_login: ^3.0.0
email_validator: ^2.0.1
image_picker: ^0.8.4+1
http: ^0.13.3
get_it: ^7.2.0
url_launcher: ^6.0.10
Here's the response from flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.1 20C69 darwin-x64, locale en-GB)
• Flutter version 2.2.3 at /Users/tarekfaysal/fvm/versions/stable
• Framework revision f4abaa0735 (3 months ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /users/tarekfaysal/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.11.0
[✓] 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-7281165)
[✓] VS Code (version 1.60.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.26.0
[✓] Connected device (2 available)
• Mi A2 (mobile) • fff60a • android-arm64 • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61
• No issues found!
I tried "flutter clean" and uninstalling the app from local device and did "flutter run", still this error persists.
Please help!

As the documentation shows, you need to add this in your androidManifest.xml file (for android):
<queries>
<!-- If your app opens https URLs -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<!-- If your app makes calls -->
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<!-- If your sends SMS messages -->
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="smsto" />
</intent>
<!-- If your app sends emails -->
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>
For IOS, add this in your Info.plist file:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
<string>http</string>
</array>
Note: You need to stop and restart your application to see the change (in your emulator).

Related

Flutter: Request is taking too long to process

I am running my application in development (debug) mode on local machine so I'm not sure how much this affects network requests. The target device where the app is running is Android emulator. I have an endpoint which fetches some data, this data can be quite large, it's a large-ish JSON that gets parsed into data structure (class) in my application code.
I am experiencing a problem where sometimes these requests time out (my timeout is set at 30s) even though the actual response is less than 5s. I am attaching a screenshot from dev tools where you can see that the duration of the request is 25 seconds which is just too much. I think time to first byte (TTFB) is the actual time before it starts receiving the data, so the server code is not slow. I don't understand how the "end" time is calculated though.
My internet connection (download) is about 50-70Mbit/s (ADSL).
Screenshot:
What do you think could be the cause for such a long duration of request to be completed? Could it be the size of payload? Or does the framework (Flutter) take a long time to process the response?
I'm using dio² http client to make my requests so not sure if that plays any role. I tried optimising the path where I'm converting JSON response payload into data objects (classes) stored in memory¹ but that doesn't seem to help. I don't think I'm using any weird code pattern³ as all of the other parts of my app are performant.
Unfortunately I can't easily reproduce the situation of what the screenshot is displaying but when I tried doing it, the payload size was over 1MB and in that scenario I believe it could be over 2MB which is pretty large for JSON.
flutter doctor -v output:
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6.1 20G224 darwin-x64, locale en-CZ)
• Flutter version 2.8.1 at /Users/user/fvm/versions/2.8.1
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/user/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-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• 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-7281165)
[✓] IntelliJ IDEA Community Edition (version 2020.2.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• 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
[✓] VS Code (version 1.58.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• SM A505FN (mobile) • XXXXXXX • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99
• No issues found!
¹ I receive list of objects in the JSON response. These objects have nested object lists. One of the lists are GPS coordinates that form a path so there can be lot of them. However I need just one list of coordinates from the list of objects so I just dropped the other ones before converting them to my data structures so it basically cuts down 90% of the previous unoptimized size.
² Version 4.0.0
³ It's a regular Flutter app where all widgets come from material.dart module. The network calls are triggered outside of UI by usage of BLoC pattern (via flutter_bloc lib). Each API call has its own event belonging to some BLoC.
The actual API call is performed by a instance of wrapper class that contains an instance of dio client and passes the result to relevant BLoC. The instances of wrapper classes and dio instances are created via dependency injection. Wrapper classes are singletons, dio instances are created once for each of these wrapper classes. The creation of these classes happens before the runApp.

Trouble creating the quickstart application

I am working through the Digital Asset quickstart guide and I am unable to run:
da new quickstart-java quickstart
I get the following output:
getting-started Built-in template for version: 0.10.9-SDK
example-bond-trading Built-in template for version: 0.0.7
example-collateral Built-in template for version: 1.0.6
example-ping-pong-grpc-java Built-in template for version: 2.2.0
example-ping-pong-reactive-components-java Built-in template for version: 2.2.0
example-ping-pong-reactive-java Built-in template for version: 2.2.0
example-repo-market Built-in template for version: 0.0.5
example-upgrade Built-in template for version: 0.0.6
It seems "quickstart-java" is not an available template. Is there a way for me to install it?
I tried running it with 'getting-started' instead of 'quickstart-java' but it's not the same thing.
Can you confirm which version of the SDK you have? Do da list at a terminal prompt and look for the active and default version. From the output, it looks like you have version 0.10.9. You'll need to upgrade to 0.11.X - latest is 0.11.3
Here's the output on my terminal:
paul:da (master)$ da list
Installed SDK releases:
0.10.0
0.10.2
0.10.3
0.10.6
0.10.8
0.10.9
0.10.12
0.10.13
0.11.0
0.11.1
0.11.2
0.11.3 (active, default)
paul:da (master)$
You can use the command da use 0.11.3 once you have upgraded to set the default SDK version for new projects.

Xcode 7.1 TestFairy SDK 1.5.0, Many Warnings with xxxx.app.dSYM

After adding the Test Fairy 1.5.0 SDK and using XCODE 7.0.1, getting many warnings like
while processing /Users/jefforthober/Dev/KidMix/KidMixiOS/KidMixCommon/TestFairy/libTestFairy.a(TFImageUtils.o):
warning: Could not resolve external type c:objc(cs)UIView
while processing /Users/jefforthober/Dev/KidMix/KidMixiOS/KidMixCommon/TestFairy/libTestFairy.a(TFGestureRecognizer.o):
warning: /var/folders/my/m6ynh3bn6tq06h7xr3js0z7r0000gn/C/org.llvm.clang.travis/ModuleCache/1Z8KETWXX2FXQ/UIKit-1V5UHAPTOD24G.pcm: No such file or directory
while processing /Users/jefforthober/Dev/KidMix/KidMixiOS/KidMixCommon/TestFairy/libTestFairy.a(TFGestureRecognizer.o):
The problem is solved with TestFairy iOS SDK 1.7.4
Just upgrade to the latest version.
http://docs.testfairy.com/iOS_SDK/Integrating_iOS_SDK.html

Build fails when ZipAligning

I have just installed Xamarin along with the plugin for Visual studio 2013 professional.
Now I have a problem when I open an Android project and I build it, it throws an error.
System.Exception: Build started.
C:\Program Files\Java\jdk1.6.0_39\\bin\jarsigner.exe -keystore "C:\Users\Asad Shafique\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\App6.App6-Signed-Unaligned.apk obj\Debug\android\bin\App6.App6.apk androiddebugkey
The specified task executable location "C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\\tools\zipalign.exe" is invalid.
Build FAILED.
What would the problem be?
Go to your Android SDK folder C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\build-tools\19.1.0 and copy "zipalign.exe" to C:\Users\Asad Shafique\AppData\Local\Android\android-sdk\tools.
Google has changed their paths in the latest SDK.
Xamarin forum discussion

How to develop for AIR 2.7

How I can develop AIR applications for version 2.7? I've downloaded the AIR SDK, but when I change application.xml to:
<application xmlns="http://ns.adobe.com/air/application/2.7">
The compiler shows the error:
Invalid application descriptor: Unknow namespace: http://ns.adobe.com/air/application/2.7.
What am I missing?
Add target-player=11 to your compiler arguments