我的颤振应用程序在启动屏幕上冻结,我得到以下错误日志:
Built build\app\outputs\apk\debug\app-debug.apk.
I/Choreographer(18870): Skipped 75 frames! The application may be doing too much work on its main thread.
D/EGL_emulation(18870): eglMakeCurrent: 0xe8885480: ver 3 0 (tinfo 0xe88835a0)
I/OpenGLRenderer(18870): Davey! duration=2142ms; Flags=1, IntendedVsync=65263803118670, Vsync=65265053118620, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=65265065657900, AnimationStart=65265065738100, PerformTraversalsStart=65265065780200, DrawStart=65265126086300, SyncQueued=65265197367200, SyncStart=65265199471900, IssueDrawCommandsStart=65265199680700, SwapBuffers=65265651453000, FrameCompleted=65265947767800, DequeueBufferDuration=12659000, QueueBufferDuration=920000,
Syncing files to device Android SDK built for x86...
E/flutter (18870): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
Syncing files to device Android SDK built for x86...
E/flutter (18870): <asynchronous suspension>
Syncing files to device Android SDK built for x86...
E/flutter (18870): #1 getApplicationDocumentsDirectory (package:path_provider/path_provider.dart:84:22)
Syncing files to device Android SDK built for x86...
E/flutter (18870): <asynchronous suspension>
Syncing files to device Android SDK built for x86...
E/flutter (18870): #2 DbContext.initDb (package:appentrega/database.dart:34:45)
Syncing files to device Android SDK built for x86...
E/flutter (18870): <asynchronous suspension>
Syncing files to device Android SDK built for x86...
E/flutter (18870): #3 DbContext.getContext (package:appentrega/database.dart:27:21)
Syncing files to device Android SDK built for x86...
E/flutter (18870): <asynchronous suspension>
Syncing files to device Android SDK built for x86...
E/flutter (18870): #4 _SplashScreenState.startTime (package:appentrega/splash.dart:16:34)
Syncing files to device Android SDK built for x86...
E/flutter (18870): <asynchronous suspension>
Syncing files to device Android SDK built for x86...
E/flutter (18870): #5 _SplashScreenState.initState (package:appentrega/splash.dart:33:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4068:58)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #10 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #14 Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #15 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #19 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #21 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #22 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #25 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #27 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #28 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #29 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #30 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #31 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #32 Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #33 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #34 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4088:11)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #35 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #37 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #39 Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #40 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #41 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #42 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #43 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
Syncing files to device Android SDK built for x86...
E/flutter (18870): #44
Syncing files to device Android SDK built for x86...
D/EGL_emulation(18870): eglMakeCurrent: 0xe8885720: ver 3 0 (tinfo 0xe88832f0)
Syncing files to device Android SDK built for x86...
4.034ms (!)
看起来问题就在这里:[ERROR: flutter/lib/ui/ui_dart_state.cc(148)]未处理的异常:缺少插件异常(在通道plugins.flutter.io/path_provider上没有找到方法getApplication ationDocumentsDirectory的实现)
已经这样做了:
-删除了所有插件并重新安装了flutter pub get
。
-运行flutter net
和flutter run
网页的颤动
在开始向应用程序添加web支持后,我遇到了这种情况。getApplicationDocumentsDirectory()函数仅支持iOS和Android(文档)。我添加了一个web检查,并更改了设置目录的方式,从而为我修复了“找不到方法的实现”。
要判断平台是否为web,请使用颤振的kIsWeb:
import 'package:flutter/foundation.dart' show kIsWeb;
然后处理相应的目录设置:
if (kIsWeb) {
// Set web-specific directory
} else {
appDocumentDirectory = await path_provider.getApplicationDocumentsDirectory();
}
在构建发布版apk后,我在另一个插件中遇到了这个错误,这是因为默认情况下启用了代码收缩功能-如果你不想缩小/模糊代码,只需在android/app/build中添加两行代码即可。格拉德尔。
android {
...
buildTypes {
release {
...
shrinkResources false
minifyEnabled false
}
}
}
此错误通常发生在您获得插件而不再构建应用程序时。如果这是你在pubspec上获得插件后的情况。yaml重新安装您的apk。如果这不是您的问题,您是否为kotlin和swift创建了支持项目?我不知道情况是否如此,但大多数插件都需要这样做
我在这里得到这个错误。并且,试图解决它。 > E/flatter(14838):[错误:flatter/lib/ui/ui_dart_state.cc(177)]未处理的异常:缺少PluginException(在通道插件上找不到方法getApplicationDocumentsDirectory.flatter.io/path_provider的实现)E/flatter(14838):\0 Ge
未处理的异常:MissingPluginException(在channel Flatter_inapp上找不到方法initConnection的实现)。当我在android上使用Flatter in-app purchase插件时,会出现MissingPluginException异常。在iOS上,它运行得很好 当我运行或调试应用程序时,会出现以下错误:
共享的首选项:^0.5。12 4 错误日志: 颤振sdk详细信息: [✓]Flutter(通道稳定,1.22.5,在Mac OS X 10.14.6 18G7016 darwin-x64,美国本地)Flutter版本1.22.5在 /Users/taleb/Developer/flutter框架修订7891006299 (6周前),2020-12-10 11:54:40 -0800引擎修订ae90
我刚刚从颤振中复制了代码。dev并对其进行了修改,出现以下错误 E/flatter(2639):[ERROR:flatter/lib/ui/ui\u dart\u state.cc(177)]未处理的异常:MissingPluginException(在通道My channel上找不到方法myNativeFunction的实现)*我想将一条消息从本机java代码打印到Flatter ui*
Xcode的输出:在文件中包含从 /Users/dani/development/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.3/ios/Classes/FLTURLLauncherPlugin.m: 7: /Users/dani/development/flutter/.pub-cache/hosted/pub.dart
我得到下面的异常,而在Android Studio运行flutter代码。 I/颤振(5360):══╡ WIDGETS库捕获到异常╞═══════════════════════════════════════════════════════════ I/flatter(5360):在构建文本(“xyz”)时抛出以下断言:I/flatter(5360):未找到方向性小部件。I/flatter(5