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
Related
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.
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.
Since yesterday, when I use a GestureDetector with the url_launcher package I'm getting this error:
E/flutter (17573): #0 _musicAreaState._launchURL (package:GiramosApp/ui/views/home_screen/widgets/music_area.dart:37:7)
E/flutter (17573): <asynchronous suspension>
E/flutter (17573): #1 _musicAreaState.build.<anonymous closure> (package:GiramosApp/ui/views/home_screen/widgets/music_area.dart:55:13)
E/flutter (17573): #2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24)
E/flutter (17573): #3 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11)
E/flutter (17573): #4 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5)
E/flutter (17573): #5 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:259:7)
E/flutter (17573): #6 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157:27)
E/flutter (17573): #7 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:224:20)
E/flutter (17573): #8 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
E/flutter (17573): #9 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:263:11)
E/flutter (17573): #10 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:157:7)
E/flutter (17573): #11 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:103:7)
E/flutter (17573): #12 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:87:7)
E/flutter (17573): #13 _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter (17573): #14 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17573): #15 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17573): #16 _invoke1 (dart:ui/hooks.dart:265:10)
E/flutter (17573): #17 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)
E/flutter (17573): ```
Any thoughts?
I found the error, I don't know why but it works deleting the async function. So, the result it's:
launchUrl(url) {
launch(url);
}
On iOS it works with the async flavour, but not on Android.
From API30 (Android 11) onwards, your Android app has to list all apps it interacts with.
Add this in your android manifest file (android > app > src > main > AndroidManifest.xml)
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
Install the package properly using the steps given here. You should add a dependency of url_launcher in pubspec.yaml file. If you have done that,
To solve this issue you should clean the project using flutter clean, and then you upgrade your flutter using flutter upgrade. This will solve the problem for sure. If not, you create a new project and then paste the code in it.
I'm trying o create a flutter application. and I have success working with login with Facebook and Twitter. there is a problem while I'm trying to login with Twitter. My device has not been installed on the twitter application and I'm facing the problem for null value assign. Have anyone maid a solution for the issue.
E/flutter (20681): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'token' was called on null.
E/flutter (20681): Receiver: null
E/flutter (20681): Tried calling: token
E/flutter (20681): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter (20681): #1 _LoginScreenState._loginWithTwitter (package:c2c_app/src/screens/Account/Login/login_page.dart:104:39)
E/flutter (20681): <asynchronous suspension>
E/flutter (20681): #2 _LoginScreenState._buildLoginWidget.<anonymous closure> (package:c2c_app/src/screens/Account/Login/login_page.dart:581:40)
E/flutter (20681): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter (20681): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
E/flutter (20681): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (20681): #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter (20681): #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter (20681): #8 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236:7)
E/flutter (20681): #9 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (20681): #10 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter (20681): #11 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (20681): #12 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (20681): #13 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (20681): #14 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (20681): #15 _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter (20681): #16 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (20681): #17 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter (20681): #18 _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter (20681): #19 _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)
E/flutter (20681):
you need to just put try and catch block inside twitter login code
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.