Unhandled Exception: MissingPluginException(No implementation found
for method initConnection on channel flutter_inapp).When I use
flutter in-app purchase plugin for the android,
MissingPluginExceptionexception occurs. On iOS, it works nicely
When I run or debug app it gives the error that :
E/flutter ( 7718): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method initConnection on channel flutter_inapp)
E/flutter ( 7718): #0 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:157
E/flutter ( 7718): <asynchronous suspension>
E/flutter ( 7718): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
E/flutter ( 7718): #2 FlutterInappPurchase.initConnection
package:flutter_inapp_purchase/flutter_inapp_purchase.dart:85
E/flutter ( 7718): <asynchronous suspension>
E/flutter ( 7718): #3 PaymentService.initConnection
package:social_app/services/payment_service.dart:98
E/flutter ( 7718): #4 _CourseTabState.fetchCarevanAcademy
package:social_app/…/course_tab/course_tab.dart:96
E/flutter ( 7718): <asynchronous suspension>
E/flutter ( 7718): #5 _CourseTabState.initState
package:social_app/…/course_tab/course_tab.dart:38
E/flutter ( 7718): #6 StatefulElement._firstBuild
package:flutter/…/widgets/framework.dart:4765
E/flutter ( 7718): #7 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #8 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #9 MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6236
E/flutter ( 7718): #10 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #11 Element.updateChild
package:flutter/…/widgets/framework.dart:3327
E/flutter ( 7718): #12 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4652
E/flutter ( 7718): #13 Element.rebuild
package:flutter/…/widgets/framework.dart:4343
E/flutter ( 7718): #14 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4606
E/flutter ( 7718): #15 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #16 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #17 Element.updateChild
package:flutter/…/widgets/framework.dart:3327
E/flutter ( 7718): #18 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4652
E/flutter ( 7718): #19 Element.rebuild
package:flutter/…/widgets/framework.dart:4343
E/flutter ( 7718): #20 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4606
E/flutter ( 7718): #21 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #22 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #23 Element.updateChild
package:flutter/…/widgets/framework.dart:3327
E/flutter ( 7718): #24 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4652
E/flutter ( 7718): #25 Element.rebuild
package:flutter/…/widgets/framework.dart:4343
E/flutter ( 7718): #26 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:4606
E/flutter ( 7718): #27 ComponentElement.mount
package:flutter/…/widgets/framework.dart:4601
E/flutter ( 7718): #28 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
E/flutter ( 7718): #29 MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6236
E/flutter ( 7718): #30 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3569
Close the app and execute flutter run command.
Related
E/flutter (17310): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioError [DioErrorType.other]: HandshakeException: Handshake error in client (OS Error: E/flutter (17310): CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393)) E/flutter (17310): Source stack: E/flutter (17310): #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:488:35) E/flutter (17310): #1 DioMixin.request (package:dio/src/dio_mixin.dart:483:12) E/flutter (17310): #2 DioMixin.get (package:dio/src/dio_mixin.dart:61:12) E/flutter (17310): #3 getState (package:land_resource_inventory/modules/home/view/home_page.dart:355:28) E/flutter (17310): #4 _onTileClicked (package:land_resource_inventory/modules/home/view/home_page.dart:345:7) E/flutter (17310): #5 _MyHomePageState.build.<anonymous closure>.<anonymous closure> (package:land_resource_inventory/modules/home/view/home_page.dart:232:40) E/flutter (17310): #6 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1072:21) E/flutter (17310): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24) E/flutter (17310): #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11) E/flutter (17310): #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5) E/flutter (17310): #10 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:276:7) E/flutter (17310): #11 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:163:27) E/flutter (17310): #12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:464:20) E/flutter (17310): #13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22) E/flutter (17310): #14 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:337:11) E/flutter (17310): #15 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7) E/flutter (17310): #16 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5) E/flutter (17310): #17 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7) E/flutter (17310): #18 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7) E/flutter (17310): #19 _invoke1 (dart:ui/hooks.dart:167:13) E/flutter (17310): #20 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341:7) E/flutter (17310): #21 _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31) E/flutter (17310): E/flutter (17310): #0 DioMixin.fetch.<anonymous closure> (package:dio/src/dio_mixin.dart:643:7) E/flutter (17310): #1 _RootZone.runBinary (dart:async/zone.dart:1658:54) E/flutter (17310): #2 _FutureListener.handleError (dart:async/future_impl.dart:162:22) E/flutter (17310): #3 Future._propagateToListeners.handleError (dart:async/future_impl.dart:778:47) E/flutter (17310): #4 Future._propagateToListeners (dart:async/future_impl.dart:799:13) E/flutter (17310): #5 Future._completeError (dart:async/future_impl.dart:574:5) E/flutter (17310): #6 _SyncCompleter._completeError (dart:async/future_impl.dart:51:12) E/flutter (17310): #7 _Completer.completeError (dart:async/future_impl.dart:23:5) E/flutter (17310): #8 Future.any.onError (dart:async/future.dart:617:45) E/flutter (17310): #9 _RootZone.runBinary (dart:async/zone.dart:1658:54) E/flutter (17310): #10 _FutureListener.handleError (dart:async/future_impl.dart:162:22) E/flutter (17310): #11 Future._propagateToListeners.handleError (dart:async/future_impl.dart:778:47) E/flutter (17310): #12 Future._propagateToListeners (dart:async/future_impl.dart:799:13) E/flutter (17310): #13 Future._completeError (dart:async/future_impl.dart:574:5) E/flutter (17310): #14 Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:665:7) E/flutter (17310): #15 _microtaskLoop (dart:async/schedule_microtask.dart:40:21) E/flutter (17310): #16 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
I have already tried:
https://stackoverflow.com/a/61312927/1776243
Although this is not recommended in production scenarios, you can accept any certificates by overriding the HttpClient that dio uses by providing a onHttpClientCreate, like the following :
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
client.badCertificateCallback=(X509Certificate cert, String host, int port){
return true;
};
};
Again, only use this for debugging and development purposes. In production, you should use a valid SSL certificate.
Documentation for onHttpClientCreate
I try to make a to do list application. I am trying usb debugging on my tablet. I used sqflite in my project.
Errors
E/flutter ( 5866): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Future<Database?>' is not a subtype of type 'Database' in type cast
E/flutter ( 5866): #0 database_transactions.get_tables (package:todolistapp/database/database.dart:32:26)
E/flutter ( 5866): #1 _task_book_screenState.buildTaskBooks.<anonymous closure> (package:todolistapp/screens/task-book-screen.dart:38:10)
E/flutter ( 5866): #2 State.setState (package:flutter/src/widgets/framework.dart:1114:30)
E/flutter ( 5866): #3 _task_book_screenState.buildTaskBooks (package:todolistapp/screens/task-book-screen.dart:37:5)
E/flutter ( 5866): #4 _task_book_screenState.buildBody (package:todolistapp/screens/task-book-screen.dart:30:9)
E/flutter ( 5866): #5 _task_book_screenState.build (package:todolistapp/screens/task-book-screen.dart:22:13)
E/flutter ( 5866): #6 StatefulElement.build (package:flutter/src/widgets/framework.dart:4992:27)
E/flutter ( 5866): #7 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4878:15)
E/flutter ( 5866): #8 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
E/flutter ( 5866): #9 Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
E/flutter ( 5866): #10 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4859:5)
E/flutter ( 5866): #11 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5041:11)
E/flutter ( 5866): #12 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4853:5)
E/flutter ( 5866): #13 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #14 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #15 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6300:14)
E/flutter ( 5866): #16 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #17 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
E/flutter ( 5866): #19 Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
E/flutter ( 5866): #20 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4859:5)
E/flutter ( 5866): #21 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4853:5)
E/flutter ( 5866): #22 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #23 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #24 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6300:14)
E/flutter ( 5866): #25 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #26 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #27 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6300:14)
E/flutter ( 5866): #28 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #29 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #30 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
E/flutter ( 5866): #31 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
E/flutter ( 5866): #32 Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
E/flutter ( 5866): #33 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4859:5)
E/flutter ( 5866): #34 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5041:11)
E/flutter ( 5866): #35 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4853:5)
E/flutter ( 5866): #36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #37 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #38 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6300:14)
E/flutter ( 5866): #39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3863:16)
E/flutter ( 5866): #40 Element.updateChild (package:flutter/src/widgets/framework.dart:3592:18)
E/flutter ( 5866): #41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4904:16)
E/flutter ( 5866): #42 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5050:11)
E/flutter ( 5866): #43 Element.rebuild (package:flutter/src/widgets/framework.dart:4604:5)
E/flutter ( 5866): #44 ComponentElement._firstBuild (package:flutter/s
I/flutter ( 5866): error type 'Future<Database?>' is not a subtype of type 'Database' in type cast during open, closing...
E/flutter ( 5866): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Future<Database?>' is not a subtype of type 'Database' in type cast
E/flutter ( 5866): #0 database_transactions.create_default_table (package:todolistapp/database/database.dart:25:26)
E/flutter ( 5866): #1 SqfliteDatabaseMixin.doOpen.<anonymous closure> (package:sqflite_common/src/database_mixin.dart:910:42)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #2 SqfliteDatabaseMixin._runTransaction (package:sqflite_common/src/database_mixin.dart:669:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #3 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #4 SqfliteDatabaseMixin.txnSynchronized (package:sqflite_common/src/database_mixin.dart:392:14)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #5 SqfliteDatabaseMixin.doOpen (package:sqflite_common/src/database_mixin.dart:899:13)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #6 SqfliteDatabaseOpenHelper.openDatabase (package:sqflite_common/src/database.dart:46:7)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #7 SqfliteDatabaseFactoryMixin.openDatabase.<anonymous closure> (package:sqflite_common/src/factory_mixin.dart:110:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #8 ReentrantLock.synchronized.<anonymous closure> (package:synchronized/src/reentrant_lock.dart:37:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #9 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #10 database_transactions.connect_database (package:todolistapp/database/database.dart:20:22)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #11 database_transactions.dbConn (package:todolistapp/database/database.dart:11:23)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866):
I/flutter ( 5866): error DatabaseException(database_closed 1) during open, closing...
I/flutter ( 5866): error DatabaseException(database_closed 1) closing database 1
E/flutter ( 5866): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DatabaseException(database_closed 1)
E/flutter ( 5866): #0 wrapDatabaseException (package:sqflite/src/exception_impl.dart:11:7)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #1 SqfliteDatabaseMixin.txnRawQuery.<anonymous closure> (package:sqflite_common/src/database_mixin.dart:473:30)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #2 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #3 SqfliteDatabaseMixin.txnSynchronized (package:sqflite_common/src/database_mixin.dart:392:14)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #4 SqfliteDatabaseMixin.getVersion (package:sqflite_common/src/database_mixin.dart:695:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #5 SqfliteDatabaseMixin.doOpen (package:sqflite_common/src/database_mixin.dart:896:28)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #6 SqfliteDatabaseOpenHelper.openDatabase (package:sqflite_common/src/database.dart:46:7)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #7 SqfliteDatabaseFactoryMixin.openDatabase.<anonymous closure> (package:sqflite_common/src/factory_mixin.dart:110:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #8 ReentrantLock.synchronized.<anonymous closure> (package:synchronized/src/reentrant_lock.dart:37:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #9 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #10 database_transactions.connect_database (package:todolistapp/database/database.dart:20:22)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #11 database_transactions.dbConn (package:todolistapp/database/database.dart:11:23)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866):
I/ple.todolistap( 5866): NativeAlloc concurrent copying GC freed 21568(6871KB) AllocSpace objects, 3(60KB) LOS objects, 51% free, 1442KB/2978KB, paused 388us total 265.936ms
E/flutter ( 5866): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Future<Database?>' is not a subtype of type 'Database' in type cast
E/flutter ( 5866): #0 database_transactions.create_table (package:todolistapp/database/database.dart:38:26)
E/flutter ( 5866): #1 _task_book_add_screenState.buildCreateButton.<anonymous closure> (package:todolistapp/screens/task-book-add-screen.dart:77:16)
E/flutter ( 5866): #2 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1072:21)
E/flutter ( 5866): #3 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24)
E/flutter ( 5866): #4 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11)
E/flutter ( 5866): #5 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5)
E/flutter ( 5866): #6 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:239:7)
E/flutter ( 5866): #7 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:615:9)
E/flutter ( 5866): #8 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
E/flutter ( 5866): #9 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
E/flutter ( 5866): #10 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)
E/flutter ( 5866): #11 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
E/flutter ( 5866): #12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
E/flutter ( 5866): #13 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:460:19)
E/flutter ( 5866): #14 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
E/flutter ( 5866): #15 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:337:11)
E/flutter ( 5866): #16 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
E/flutter ( 5866): #17 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
E/flutter ( 5866): #18 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
E/flutter ( 5866): #19 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
E/flutter ( 5866): #20 _invoke1 (dart:ui/hooks.dart:167:13)
E/flutter ( 5866): #21 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341:7)
E/flutter ( 5866): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
E/flutter ( 5866):
I/flutter ( 5866): error type 'Future<Database?>' is not a subtype of type 'Database' in type cast during open, closing...
E/flutter ( 5866): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Future<Database?>' is not a subtype of type 'Database' in type cast
E/flutter ( 5866): #0 database_transactions.create_default_table (package:todolistapp/database/database.dart:25:26)
E/flutter ( 5866): #1 SqfliteDatabaseMixin.doOpen.<anonymous closure> (package:sqflite_common/src/database_mixin.dart:910:42)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #2 SqfliteDatabaseMixin._runTransaction (package:sqflite_common/src/database_mixin.dart:669:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #3 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #4 SqfliteDatabaseMixin.txnSynchronized (package:sqflite_common/src/database_mixin.dart:392:14)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #5 SqfliteDatabaseMixin.doOpen (package:sqflite_common/src/database_mixin.dart:899:13)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #6 SqfliteDatabaseOpenHelper.openDatabase (package:sqflite_common/src/database.dart:46:7)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #7 SqfliteDatabaseFactoryMixin.openDatabase.<anonymous closure> (package:sqflite_common/src/factory_mixin.dart:110:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #8 ReentrantLock.synchronized.<anonymous closure> (package:synchronized/src/reentrant_lock.dart:37:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #9 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #10 database_transactions.connect_database (package:todolistapp/database/database.dart:20:22)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #11 database_transactions.dbConn (package:todolistapp/database/database.dart:11:23)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866):
I/flutter ( 5866): error DatabaseException(database_closed 2) during open, closing...
I/flutter ( 5866): error DatabaseException(database_closed 2) closing database 2
E/flutter ( 5866): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DatabaseException(database_closed 2)
E/flutter ( 5866): #0 wrapDatabaseException (package:sqflite/src/exception_impl.dart:11:7)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #1 SqfliteDatabaseMixin.txnRawQuery.<anonymous closure> (package:sqflite_common/src/database_mixin.dart:473:30)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #2 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #3 SqfliteDatabaseMixin.txnSynchronized (package:sqflite_common/src/database_mixin.dart:392:14)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #4 SqfliteDatabaseMixin.getVersion (package:sqflite_common/src/database_mixin.dart:695:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #5 SqfliteDatabaseMixin.doOpen (package:sqflite_common/src/database_mixin.dart:896:28)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #6 SqfliteDatabaseOpenHelper.openDatabase (package:sqflite_common/src/database.dart:46:7)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #7 SqfliteDatabaseFactoryMixin.openDatabase.<anonymous closure> (package:sqflite_common/src/factory_mixin.dart:110:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #8 ReentrantLock.synchronized.<anonymous closure> (package:synchronized/src/reentrant_lock.dart:37:18)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #9 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #10 database_transactions.connect_database (package:todolistapp/database/database.dart:20:22)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866): #11 database_transactions.dbConn (package:todolistapp/database/database.dart:11:23)
E/flutter ( 5866): <asynchronous suspension>
E/flutter ( 5866):
My database codes
import 'dart:async';
import 'package:path/path.dart';
import "package:sqflite/sqflite.dart";
import 'package:todolistapp/data-model/task-book-data-model.dart';
class database_transactions {
Database? db_connection;
Future<Database?> get dbConn async {
if (db_connection == null) {
db_connection = await connect_database();
} else {
return db_connection;
}
return db_connection;
}
Future<Database?> connect_database() async {
String path = join(getDatabasesPath().toString(), "todolist.db");
var conclusion = await openDatabase(path, version: 1, onCreate: create_default_table);
return conclusion;
}
FutureOr<void> create_default_table(Database db, int version) {
Database db = dbConn as Database;
return db.execute("CREATE TABLE default_table (t_id INT NOT NULL PRIMARY KEY AUTOINCREMENT, t_name TEXT NOT NULL, t_content TEXT NOT NULL)");
}
Future<List<task_book_model>> get_tables() async {
task_book_model tbm = new task_book_model();
Database db = dbConn as Database;
var tables_names = db.query("sqlite_sequence");
return tbm.to_task_book_model(tables_names);
}
Future<void> create_table(task_book_model value) async {
Database db = dbConn as Database;
return db.execute("CREATE TABLE ${value.book_name} (t_id INT NOT NULL PRIMARY KEY AUTOINCREMENT, t_name TEXT NOT NULL, t_content TEXT NOT NULL)");
}
}
When i try to use database transactions, i get the errors.
Refer this:
https://pub.dev/packages/sqflite/example
and use the class name as DatabaseTransactions(). it's very useful to understand the code base for another developer.
I am making a Date Time App on Flutter that I saw on YouTube. Whenever I try to run the program, it always says "E/flutter (31302): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception:" on the console with a bunch of other packages. I don't know what to do and what solution I can do. BTW I disabled some plugin on my flutter to speed up my Android Studio. Do you think it is one of the reasons for my error? I want to show the datetime and offset to the console first like in the video. I tried opening my net in hopes of maybe not connecting to the internet might help but I still got the same error. Thank you and God Bless. Here my code.
'''
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'dart:convert';
class loading extends StatefulWidget {
#override
_loadingState createState() => _loadingState();
}
class _loadingState extends State<loading> {
void getTime() async{
Response response = await get('http://worldtimeapi.org/api/timezone/Europe/London');
Map data = jsonDecode(response.body);
//print(data);
String datetime = data['datetime'];
String offset = data['utc_offset'];
print (datetime);
print(offset);
}
#override
void initState() {
super.initState();
getTime();
}
#override
Widget build(BuildContext context) {
return Scaffold(
body: Text('Loading'),
);
}
}
'''
here is the error message:
'''
Launching lib\main.dart on CPH1803 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Waiting for CPH1803 to report its views...
Debug service listening on ws://127.0.0.1:63067/xeetvh83VWI=/ws
Syncing files to device CPH1803...
D/libc-netbsd(12939): [getaddrinfo]: hostname=worldtimeapi.org; servname=(null); app_pid=12939; app_uid=10145; ai_flags=1024; ai_family=0; ai_socktype=1 from prox result 0
E/flutter (12939): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception:
E/flutter (12939): #0 IOClient.send (package:http/src/io_client.dart:62:7)
E/flutter (12939): <asynchronous suspension>
E/flutter (12939): #1 BaseClient._sendUnstreamed (package:http/src/base_client.dart:91:38)
E/flutter (12939): #2 BaseClient.get (package:http/src/base_client.dart:27:7)
E/flutter (12939): #3 get.<anonymous closure> (package:http/http.dart:46:36)
E/flutter (12939): #4 _withClient (package:http/http.dart:166:20)
E/flutter (12939): #5 get (package:http/http.dart:46:5)
E/flutter (12939): #6 _loadingState.getTime (package:world_time/pages/loading.dart:12:31)
E/flutter (12939): #7 _loadingState.initState (package:world_time/pages/loading.dart:27:5)
E/flutter (12939): #8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4765:58)
E/flutter (12939): #9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter (12939): #10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #11 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #12 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter (12939): #13 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #14 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #15 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4652:16)
E/flutter (12939): #16 Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
E/flutter (12939): #17 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
E/flutter (12939): #18 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter (12939): #19 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #20 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #21 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter (12939): #22 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #23 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #24 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter (12939): #25 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #26 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #27 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4652:16)
E/flutter (12939): #28 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4800:11)
E/flutter (12939): #29 Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
E/flutter (12939): #30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
E/flutter (12939): #31 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4791:11)
E/flutter (12939): #32 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter (12939): #33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #34 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #35 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter (12939): #36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #37 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #38 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6118:14)
E/flutter (12939): #39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #40 Element.updateChild (package:flutter/src/widgets/framework.dart:3327:18)
E/flutter (12939): #41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4652:16)
E/flutter (12939): #42 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4800:11)
E/flutter (12939): #43 Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
E/flutter (12939): #44 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)
E/flutter (12939): #45 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4791:11)
E/flutter (12939): #46 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
E/flutter (12939): #47 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
E/flutter (12939): #48 Ele
'''
If my question is still confusing please let me know so that I can give the problem. Please help me Thank you.
I am using this library to use forground service in a flutter app i am trying the sample app in the example of this package but i am getting error which i am not able to understand
Unhandled Exception: MissingPluginException(No implementation found for method foregroundServiceIsStarted on channel org.thebus.foreground_service/main)
E/flutter ( 9491): #0 MethodChannel._invokeMethod
(package:flutter/src/services/platform_channel.dart:154:7)
E/flutter ( 9491): <asynchronous suspension>
E/flutter ( 9491): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter ( 9491): #2 ForegroundService._invokeMainChannel (package:foreground_service/foreground_service.dart:21:33)
E/flutter ( 9491): #3 ForegroundService.foregroundServiceIsStarted (package:foreground_service/foreground_service.dart:133:18)
E/flutter ( 9491): #4 _MyAppState._toggleForegroundServiceOnOff (package:foregroundserviceflutter/main.dart:66:50)
E/flutter ( 9491): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19)
E/flutter ( 9491): #6 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:862:36)
E/flutter ( 9491): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter ( 9491): #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
E/flutter ( 9491): #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter ( 9491): #10 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:254:7)
E/flutter ( 9491): #11 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter ( 9491): #12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter ( 9491): #13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter ( 9491): #14 GestureBinding._handlePointerEvent
(package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 9491): #15 GestureBinding._flushPointerEventQueue
(package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 9491): #16 GestureBinding._handlePointerDataPacket
(package:flutter/src/gestures/binding.dart:86:7)
Any suggestion on what's going wrong in this
i have added the following plugin also – #Neelay Srivastava
MissingPluginException
what ever plugin you add it is not integrated in app although the plugin is get by pub
but not interacted in app for that you just have to quit app and build again
So, I followed this article from 60devs, on how to implement native Webview in flutter using PlatformView. I followed the article exactly but I get this error:
Unhandled Exception: PlatformException(error, Trying to create a platform view of unregistered type: webview, null)
My minimum SDK version is greater than 20 (21 currently).
I have internet permission in my AndroidManifest.xml file.
I have tried flutter clean.
But nothing works.
flutter run error:
E/flutter ( 8794): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Trying to create a platform view of unregistered type: webview, null)
E/flutter ( 8794): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:564
E/flutter ( 8794): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:316
E/flutter ( 8794): <asynchronous suspension>
E/flutter ( 8794): #2 AndroidViewController._create
package:flutter/…/services/platform_views.dart:639
E/flutter ( 8794): <asynchronous suspension>
E/flutter ( 8794): #3 AndroidViewController.setSize
package:flutter/…/services/platform_views.dart:556
E/flutter ( 8794): <asynchronous suspension>
E/flutter ( 8794): #4 RenderAndroidView._sizePlatformView
package:flutter/…/rendering/platform_view.dart:189
E/flutter ( 8794): <asynchronous suspension>
E/flutter ( 8794): #5 RenderAndroidView.performResize
package:flutter/…/rendering/platform_view.dart:170
E/flutter ( 8794): #6 RenderObject.layout
package:flutter/…/rendering/object.dart:1604
E/flutter ( 8794): #7 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #8 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #9 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #10 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #11 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #12 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #13 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #14 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #15 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #16 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #17 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #18 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #19 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout
package:flutter/…/rendering/proxy_box.dart:105
E/flutter ( 8794): #20 RenderObject.layout
package:flutter/…/rendering/object.dart:1619
E/flutter ( 8794): #21 RenderOffstage.performLayout
package:flutter/…/rendering/proxy_box.dart:3074
Can you please look at the code in this article, it's short and simple. And tell me what went wrong?
Please print the info of flutter doctor -v, maybe 1.5.4hotfix can't work with platform view.