在应用程序启动时获取此错误。最初我认为这是一个迁移到Android的问题,做了所有的步骤迁移到androidx支持库,但没有用。
无法调试,因为我在主函数第一行的断点命中之前得到了这个错误。
错误
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...
E/flutter (30114): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: type 'List<String>' is not a subtype of type 'ReactiveFeedsRepository' of 'feedsRepository'
E/flutter (30114): #0 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:185:38)
E/flutter (30114): #1 _rootRun (dart:async/zone.dart:1124:13)
E/flutter (30114): #2 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (30114): #3 _runZoned (dart:async/zone.dart:1516:10)
E/flutter (30114): #4 runZoned (dart:async/zone.dart:1500:12)
E/flutter (30114): #5 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:180:5)
E/flutter (30114): #6 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:300:19)
E/flutter (30114): #7 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
E/flutter (30114):
Syncing files to device ONEPLUS A5000...
V/FA (30114): Inactivity, disconnecting from the service
我的扑动医生
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.13.6 17G65, locale en-SG)
• Flutter version 1.2.1 at /Users/harshvardhan/Documents/work/portable/flutter
• Framework revision 8661d8aecd (13 days ago), 2019-02-14 19:19:53 -0800
• Engine revision 3757390fa4
• Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/harshvardhan/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/harshvardhan/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.3.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] Connected device (1 available)
• ONEPLUS A5000 • fe6f9295 • android-arm64 • Android 9 (API 28)
主要的飞奔
void main([
ReactiveTodosRepository todosRepository,
ReactiveFeedsRepository feedsRepository,
ReactiveUserFeedsRepository userFeedsRepository,
ReactiveAuditRepository auditRepository,
UserFirebaseRepository userRepository,
SCUserRepositoryImpl scUserRepository
]) async {
bool isInDebugMode = true;
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitDown,
DeviceOrientation.portraitUp,
]);
FlutterError.onError = (FlutterErrorDetails details) {
if (isInDebugMode) {
// In development mode simply print to console.
FlutterError.dumpErrorToConsole(details);
} else {
// In production mode report to the application zone to report to
// Crashlytics.
Zone.current.handleUncaughtError(details.exception, details.stack);
}
};
await FlutterCrashlytics().initialize();
runZoned<Future<Null>>(() async {
runApp(ReduxApp(
todosRepository: todosRepository,
feedsRepository: feedsRepository,
userFeedsRepository: userFeedsRepository,
auditRepository: auditRepository,
userRepository: userRepository,
scUserRepository: scUserRepository,
));
}, onError: (error, stackTrace) async {
// Whenever an error occurs, call the `reportCrash` function. This will send
// Dart errors to our dev console or Crashlytics depending on the environment.
await FlutterCrashlytics().reportCrash(error, stackTrace, forceCrash: false);
});
}
class ReduxApp extends StatelessWidget {
final Store<AppState> store;
ReduxApp({
Key key,
ReactiveTodosRepository todosRepository,
ReactiveFeedsRepository feedsRepository,
ReactiveUserFeedsRepository userFeedsRepository,
ReactiveAuditRepository auditRepository,
UserFirebaseRepository userRepository,
SCUserRepositoryImpl scUserRepository,
}) : store = Store<AppState>(
appReducer,
initialState: AppState.initial(),
middleware: createStoreTodosMiddleware(
todosRepository ??
FirestoreReactiveTodosRepository(Firestore.instance),
feedsRepository ??
FirestoreReactiveFeedsRepository(Firestore.instance),
userFeedsRepository ??
FirestoreReactiveUserFeedsRepository(Firestore.instance),
auditRepository ?? AuditAPIRepository(),
userRepository ?? FirebaseUserRepository(FirebaseAuth.instance),
scUserRepository ?? SCUserRepositoryImpl(),
),
),
super(key: key) {
store.dispatch(InitAppAction());
}
@override
Widget build(BuildContext context) {
return StoreProvider(
store: store,
child: MaterialApp(
debugShowCheckedModeBanner: false,
title: FirestoreReduxLocalizations().appTitle,
theme: ArchSampleTheme.theme,
localizationsDelegates: [
ArchSampleLocalizationsDelegate(),
FirestoreReduxLocalizationsDelegate(),
],
routes: {
ArchSampleRoutes.signin: (context) => SignIn(),
ArchSampleRoutes.newPassword: (context) => NewPassword(),
ArchSampleRoutes.home: (context) => HomeScreen(),
ArchSampleRoutes.analytics: (context) => Chart(),
ArchSampleRoutes.addTodo: (context) => AddTodo(),
ArchSampleRoutes.forgotPasswordEmailPrompt: (context) => ForgotPasswordEmailPromptScreen(),
ArchSampleRoutes.forgotPasswordOtpPrompt: (context) => ForgotPasswordOtpPromptScreen(),
},
),
);
}
}
请检查请求类型是GET还是POST。如果您调用获取请求作为发布请求,它会显示此错误。如果请求类型正确,请检查您的JSON响应是否为JSON格式。我希望它能有所帮助。
这是一个类型不匹配错误。请确保返回类型与变量类型相同
当我将Flutter从1.0.3迁移到1.2.1时,我也遇到了类似的问题。我发现的问题与在val main
方法上定义的参数有关。调用main时,这些参数永远不会传递。要解决此问题,您可以删除这些参数,并对正在使用它的其他地方进行以下更改。
void main() async {
.
.
.
runZoned<Future<Null>>(() async {
runApp(ReduxApp());
.
.
.
ReduxApp({
Key key}) : store = Store<AppState>(
appReducer,
initialState: AppState.initial(),
middleware: createStoreTodosMiddleware(
FirestoreReactiveTodosRepository(Firestore.instance),
FirestoreReactiveFeedsRepository(Firestore.instance),
FirestoreReactiveUserFeedsRepository(Firestore.instance),
AuditAPIRepository(),
FirebaseUserRepository(FirebaseAuth.instance),
SCUserRepositoryImpl(),
),
.
.
.
我试图在showDialog中处理http请求的错误,然后抛出一个错误,但我遇到了这个错误 错误 E/颤振(18769):#13文本输入_HandletExtInput职业包:颤振/../services/text\u输入。飞镖:968 E/颤振(18769):#14通道_handleAsMethodCall包:颤振/../services/platform\u频道。dart:402E/颤振(18
有人能解决这个问题吗? E/flutter(6629):尝试呼叫: createUserSusEmailAndPassword(email:"nehalt88@gmail.com",密码:"123456")E/flutter(6629):#0Object.noSuchMethod(飞镖: core-patch/object_patch.dart:63: 5)E/flutter(6629):#1Re
我正在调用一个post API,在该API中,我必须发送FormData,但在接收到响应后,当我尝试解析该响应时,我得到了以下异常。 我得到以下错误: 下面是我的模型课https://gist.github.com/achinverma/641774f50d27b2f4f5be9f1c341f0fc2
我对颤振世界还不熟悉,我犯了一个我不能完全理解的错误。 这是我的netwrok处理程序代码 这是我的代码,我调用网络处理器的获取方法 我得到了这个错误 [错误:flatter/lib/ui/ui\u dart\u state.cc(209)]未处理的异常:类型'\u InternalLinkedHashMap 谁能帮帮我吗?
我是Flutter的新手,试图验证用户,但我面临一个错误,即使在终端中接收到响应状态200,因此我无法导航到授权页面。 请问有人能帮我吗? 登录-屏幕代码: 登录api代码: 类用户信息: 带json的邮递员:我的json 错误:终端错误 非常感谢!!
我试图从一个API获取数据,但我一直得到上面的错误。下面是我的API响应的结构 下面是我如何获取数据的 知道我做错了什么吗?