我目前正在为Android中的以下问题而挣扎:颤振共享插件和url_launcher插件在实际的发布安装中不起作用。在调试(物理设备和仿真器)中,一切都工作得很好。
此外,当发布版本在物理设备上运行(从vscode)时,一切都正常。
但是,一旦安装了发行版,插件就不再可用了.
我花了大约3天时间测试我的颤振应用程序,并能够复制错误。
我发现了以下情况:
的方式工作。
互联网权限是在Android.Manifest中添加的。编译和SDK版本是29。Min版本是21。
我真的希望有人能给我一个关于如何克服MissingPluginException问题的提示。
有一种力量能让插件在发布时注册吗?
F 223
谢谢您抽时间见我!
尝试使用或共享插件:时引发的url_launcher错误
E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method share on channel plugins.flutter.io/share)
11-11 20:36:28.091 23069 23094 E flutter : #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157)
11-11 20:36:28.091 23069 23094 E flutter : <asynchronous suspension>
11-11 20:36:28.091 23069 23094 E flutter :
11-11 20:37:19.084 23069 23094 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
11-11 20:37:19.084 23069 23094 E flutter : #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157)
11-11 20:37:19.084 23069 23094 E flutter : <asynchronous suspension>
11-11 20:37:19.084 23069 23094 E flutter : #1 canLaunch (package:url_launcher/url_launcher.dart:124)
11-11 20:37:19.084 23069 23094 E flutter : <asynchronous suspension>
11-11 20:37:19.084 23069 23094 E flutter : #2 _MyHomePageState._tryLaunchURL (package:atestapp/main.dart:36)
11-11 20:37:19.084 23069 23094 E flutter : <asynchronous suspension>
11-11 20:37:19.084 23069 23094 E flutter : #3 _MyHomePageState.build.<anonymous closure> (package:atestapp/main.dart:65)
11-11 20:37:19.084 23069 23094 E flutter : <asynchronous suspension>
11-11 20:37:19.084 23069 23094 E flutter :
11-11 20:37:20.273 3896 9400 D ClClient: Not sending keepalive. Current connection state=STOPPED
颤振医生-v输出:
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.18363.1198], locale de-DE)
• Flutter version 1.22.3 at C:\flutter
• Framework revision 8874f21e79 (13 days ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Android-SDK
• Platform android-29, build-tools 29.0.2
• ANDROID_SDK_ROOT = C:\Android-SDK
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[!] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code, 64-bit edition (version 1.51.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.16.0
[√] Connected device (1 available)
• Pixel 2 XL (mobile) • 801KPTM1379449 • android-arm64 • Android 11 (API 30)
! Doctor found issues in 1 category.
pubspec.yaml
name: atestapp
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
image_picker: ^0.6.7+14
url_launcher: ^5.7.10
share: ^0.6.5+4
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.0
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
发布于 2020-11-13 18:03:11
我终于找到问题了!我测试了不同的gradle插件版本,不得不将/android/build.gradle中的classpath 'com.android.tools.build:gradle:4.0.0'
和classpath 'com.android.tools.build:gradle:4.1.0'
降级为 classpath 'com.android.tools.build:gradle:3.5.0
,同时保持distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
不变。
https://stackoverflow.com/questions/64793361
复制相似问题