The Android view returned from PlatformView was already added to a parent view - flutter

I encountered this error but I got no luck in finding a solution on this. Any idea on how I can resolve or at least try to understand what is the issue? Thanks!
E/flutter (18634): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: The Android view returned from PlatformView#getView() was already added to a parent view.
E/flutter (18634): at io.flutter.plugin.platform.PlatformViewsController$1.createForTextureLayer(PlatformViewsController.java:238)
E/flutter (18634): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:122)
E/flutter (18634): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:60)
E/flutter (18634): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (18634): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (18634): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter (18634): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (18634): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (18634): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (18634): at android.os.Looper.loopOnce(Looper.java:226)
E/flutter (18634): at android.os.Looper.loop(Looper.java:313)
E/flutter (18634): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/flutter (18634): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (18634): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/flutter (18634): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/flutter (18634): , null, null)
E/flutter (18634): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter (18634): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter (18634): <asynchronous suspension>
E/flutter (18634): #2 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1146:18)
E/flutter (18634): <asynchronous suspension>
E/flutter (18634): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:792:5)
E/flutter (18634): <asynchronous suspension>
I tried to check the layout explorer but I haven't see any PlatformView so I'm stuck.

Related

Firebase OTP was working but suddenly this error appears

I am trying to use firebase OTP verification
I get this error when sending firebase OTP it was working
but suddenly this error appears
E/FirebaseAuth(17209): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17499 API key not valid. Please pass a valid API key.
E/flutter (17209): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
E/flutter (17209): #0 MethodChannelFirebaseAuth.verifyPhoneNumber.<anonymous closure> (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:660:35)
E/flutter (17209): #1 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
E/flutter (17209): #2 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
E/flutter (17209): #3 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
E/flutter (17209): #4 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
E/flutter (17209): #5 _HandleErrorStream._handleData (dart:async/stream_pipe.dart:253:10)
E/flutter (17209): #6 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
E/flutter (17209): #7 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
E/flutter (17209): #8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
E/flutter (17209): #9 _DelayedData.perform (dart:async/stream_impl.dart:515:14)
E/flutter (17209): #10 _PendingEvents.handleNext (dart:async/stream_impl.dart:620:11)
E/flutter (17209): #11 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591:7)
E/flutter (17209): #12 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (17209): #13 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
How to solve that ?

better_player stop working after add video_trimmer in flutter

Better_Player worked before adding Video_Trimmer, but after I added Video_Trimmer, it stopped playing the video, and if I remove Video_Trimmer again, Better_Player works.
Things I tested:
Uninstalling and reinstalling the application
Using lower versions of Better_Player
better_player: ^0.0.83
video_trimmer: ^1.1.3
console error is:
E/MethodChannel#better_player_channel(18557): Failed to handle method call
E/MethodChannel#better_player_channel(18557): java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior.
E/MethodChannel#better_player_channel(18557): at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:174)
E/MethodChannel#better_player_channel(18557): at com.google.android.exoplayer2.source.ProgressiveMediaSource$Factory.setDrmSessionManagerProvider(ProgressiveMediaSource.java:186)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayer.buildMediaSource(BetterPlayer.kt:430)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayer.setDataSource(BetterPlayer.kt:196)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayerPlugin.setDataSource(BetterPlayerPlugin.kt:277)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:151)
E/MethodChannel#better_player_channel(18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:138)
E/MethodChannel#better_player_channel(18557): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#better_player_channel(18557): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#better_player_channel(18557): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#better_player_channel(18557): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#better_player_channel(18557): at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#better_player_channel(18557): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#better_player_channel(18557): at android.os.Looper.loopOnce(Looper.java:210)
E/MethodChannel#better_player_channel(18557): at android.os.Looper.loop(Looper.java:299)
E/MethodChannel#better_player_channel(18557): at android.app.ActivityThread.main(ActivityThread.java:8273)
E/MethodChannel#better_player_channel(18557): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#better_player_channel(18557): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
E/MethodChannel#better_player_channel(18557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
E/flutter (18557): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(error, MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior., null, java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior.
E/flutter (18557): at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:174)
E/flutter (18557): at com.google.android.exoplayer2.source.ProgressiveMediaSource$Factory.setDrmSessionManagerProvider(ProgressiveMediaSource.java:186)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayer.buildMediaSource(BetterPlayer.kt:430)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayer.setDataSource(BetterPlayer.kt:196)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayerPlugin.setDataSource(BetterPlayerPlugin.kt:277)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:151)
E/flutter (18557): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:138)
E/flutter (18557): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (18557): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (18557): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter (18557): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (18557): at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (18557): at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (18557): at android.os.Looper.loopOnce(Looper.java:210)
E/flutter (18557): at android.os.Looper.loop(Looper.java:299)
E/flutter (18557): at android.app.ActivityThread.main(ActivityThread.java:8273)
E/flutter (18557): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (18557): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
E/flutter (18557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
E/flutter (18557): )
E/flutter (18557): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (18557): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #2 MethodChannelVideoPlayer.setDataSource (package:better_player/src/video_player/method_channel_video_player.dart:118:5)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #3 VideoPlayerController._setDataSource (package:better_player/src/video_player/video_player.dart:408:5)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #4 BetterPlayerController._setupDataSource (package:better_player/src/core/better_player_controller.dart:485:9)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557): #5 BetterPlayerController.setupDataSource (package:better_player/src/core/better_player_controller.dart:274:5)
E/flutter (18557): <asynchronous suspension>
E/flutter (18557):
W/System (18557): A resource failed to call close.
I/BufferQueueProducer(18557): [SurfaceView[com.example.meetbin/com.example.meetbin.MainActivity]#5(BLAST Consumer)5](id:487d00000006,api:1,p:18557,c:18557) disconnect: api 1
I/BufferQueueProducer(18557): [SurfaceView[com.example.meetbin/com.example.meetbin.MainActivity]#5(BLAST Consumer)5](id:487d00000006,api:0,p:-1,c:18557) disconnect: api -1
I/BufferQueueProducer(18557): [ViewRootImpl[MainActivity]#4(BLAST Consumer)4](id:487d00000005,api:1,p:18557,c:18557) disconnect: api 1
I/BLASTBufferQueue(18557): [ViewRootImpl[MainActivity]#4] destructor()
I/BufferQueueConsumer(18557): [ViewRootImpl[MainActivity]#4(BLAST Consumer)4](id:487d00000005,api:0,p:-1,c:18557) disconnect
D/DecorView[](18557): onWindowFocusChanged hasWindowFocus false
i was facing the same issue now fixed by following this #1085
to fix this just use this better_player version :
replace
better_player: ^0.0.83
by
better_player:
git:
url: https://github.com/tintran-dev/betterplayer.git
also make sure you have added the formatType for m3u8 and mdp
BetterPlayerDataSource dataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.network,
"url",
videoFormat: BetterPlayerVideoFormat.hls,
drmConfiguration: BetterPlayerDrmConfiguration(
drmType: BetterPlayerDrmType.token,
token: "Bearer=token",
),
);

Unhandled Exception: [firebase_functions/not-found] NOT_FOUND -Flutter

I am trying to implement the twilio_voice: ^0.0.9 plug in and register my firebase app at the same time but, when I run my registration function I get the error:
E/flutter (27321): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [firebase_functions/not-found] NOT_FOUND
E/flutter (27321):
E/flutter (27321): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:607
E/flutter (27321): #1 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:156
E/flutter (27321): <asynchronous suspension>
E/flutter (27321): #2 MethodChannelHttpsCallable.call
package:cloud_functions_platform_interface/…/method_channel/method_channel_https_callable.dart:23
E/flutter (27321): <asynchronous suspension>
E/flutter (27321): #3 HttpsCallable.call
package:cloud_functions/src/https_callable.dart:35
E/flutter (27321): <asynchronous suspension>
E/flutter (27321): #4 _TextScreenState.register
package:buddiesDrivers/CallScreen/TextScreen.dart:72
E/flutter (27321): <asynchronous suspension>
E/flutter (27321):
E/flutter (27321): #0 MethodChannelHttpsCallable.call
package:cloud_functions_platform_interface/…/method_channel/method_channel_https_callable.dart:39
E/flutter (27321): <asynchronous suspension>
E/flutter (27321): #1 HttpsCallable.call
package:cloud_functions/src/https_callable.dart:35
E/flutter (27321): <asynchronous suspension>
I am have firebase implemented and running and I am getting my token when logging in. The app seems to fail when calling the httpsCallable("voice-accessToken") in the app. Here is the function:
register() async {
print("voip-registtering with token ");
print("voip-calling voice-accessToken");
final function =
FirebaseFunctions.instance.httpsCallable("voice-accessToken");
final data = {
"platform": Platform.isIOS ? "iOS" : "Android",
};
final result = await function.call(data);
print("voip-result");
print(result.data);
String androidToken;
if (Platform.isAndroid) {
androidToken = await FirebaseMessaging.instance.getToken();
print("androidToken is " + androidToken);
}
TwilioVoice.instance
.setTokens(accessToken: result.data, deviceToken: androidToken);
}
Any help in the right direction would be appreciated

Flutter local notifications throwing an error

While trying to show the notifications from flutter_local_notification it throws the following error:
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): Failed to handle method call
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.setSmallIcon(FlutterLocalNotificationsPlugin.java:188)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.createNotification(FlutterLocalNotificationsPlugin.java:146)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.showNotification(FlutterLocalNotificationsPlugin.java:688)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.show(FlutterLocalNotificationsPlugin.java:827)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin.onMethodCall(FlutterLocalNotificationsPlugin.java:750)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at android.os.MessageQueue.next(MessageQueue.java:325)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/MethodChannel#dexterous.com/flutter/local_notifications(10962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/flutter (10962): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference, null)
E/flutter (10962): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (10962): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (10962): <asynchronous suspension>
E/flutter (10962): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (10962): #3 AndroidFlutterLocalNotificationsPlugin.show (package:flutter_local_notifications/src/platform_flutter_local_notifications.dart:137:21)
E/flutter (10962): #4 FlutterLocalNotificationsPlugin.show (package:flutter_local_notifications/src/flutter_local_notifications_plugin.dart:136:13)
E/flutter (10962): #5 NotificationPlugin.showNotification (package:pig_salang/models/notification_plugin.dart:94:43)
E/flutter (10962): #6 WelcomeScreen.build.<anonymous closure> (package:pig_salang/screens/welcome_screen.dart:42:36)
E/flutter (10962): #7 WelcomeScreen.build.<anonymous closure> (package:pig_salang/screens/welcome_screen.dart:41:26)
E/flutter (10962): #8 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19)
E/flutter (10962): #9 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:862:36)
E/flutter (10962): #10 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (10962): #11 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
E/flutter (10962): #12 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter (10962): #13 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
E/flutter (10962): #14 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
E/flutter (10962): #15 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter (10962): #16 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9)
E/flutter (10962): #17 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter (10962): #18 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
E/flutter (10962): #19 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
E/flutter (10962): #20 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (10962): #21 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (10962): #22 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (10962): #23 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (10962): #24 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (10962): #25 _rootRunUnary (dart:async/zone.dart:1196:13)
E/flutter (10962): #26 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (10962): #27 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (10962): #28 _invoke1 (dart:ui/hooks.dart:275:10)
E/flutter (10962): #29 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)
E/flutter (10962):
As far as I have researched, the similar errors were shown because of the icon. I have added used every possible way to add icons, but it is not throwing the error constantly. Obviously, I rerun the app after each changes, to make sure I don't get the error.
My code looks like:
initializePlatformSpecifics() {
var initializeAndroidSettings = AndroidInitializationSettings('app_icon'); <--- Here
var initializeIOSSettings = IOSInitializationSettings(
requestAlertPermission: false,
requestBadgePermission: true,
requestSoundPermission: true,
onDidReceiveLocalNotification: (id, title, body, payload) async {
ReceivedNotification receivedNotification = ReceivedNotification(
id: id, title: title, body: body, payload: payload);
didReceivedLocalNotificationSubject.add(receivedNotification);
},
);
initializeSettings = InitializationSettings(
initializeAndroidSettings, initializeIOSSettings);
}
I followed the tutorial. The thing is when I try to show the notification, it shows the above traceback.
I made notification icons in Android Studio -> app -> main -> res -> Image Asssets -> Notifications icon, then I made icon with name app_icon which I used to intialize the notification.
As it was not working, I also tried :
var initializeAndroidSettings = AndroidInitializationSettings('#mipmap/ic_launcher');
It also did not work. Any help would be appreciated!!!
'app_icon' was given for reference and it actually depends on where you image file is located, if you are using the default icon in mipmap folder named as ic_launcher for now then try the below code. Do let me know if it helps.
var initializeAndroidSettings
=AndroidInitializationSettings('mipmap/ic_launcher');

Flutter: type 'String' is not a subtype of type 'int' when parsing json from hosting

I'm parsing json from server and display it on screen. That is work when i parsing from localhost, but when i parsing from hosting there is an error like this
I/flutter (18089): [{"id":10,"reservation":"497538","order":"900000025301","equipment":"F6U-EA112","matcode":"6166357","description":"GASKET:2JKT;HE2;1302X1342X3MM;NASB\/CS","q_need":"1","q_available":"0","q_debt":"0","unit":"EA","location":"","required_date":null,"created_at":null,"updated_at":null},{"id":11,"reservation":"497538","order":"900000025301","equipment":"F6U-EA112","matcode":"6166345","description":"GASKET:2JKT;HE1;1302X1342X3MM;NASB\/CS","q_need":"1","q_available":"1","q_debt":"0","unit":"EA","location":"GD AUTOMOTIVE","required_date":null,"created_at":null,"updated_at":null},{"id":27,"reservation":"497566","order":"900000025329","equipment":"F6U-FA112","matcode":"6166298","description":"GASKET,SPW:IOR;24IN;150LB;GR;304\/304\/CS","q_need":"1","q_available":"0","q_debt":"0","unit":"EA","location":"GD AUTOMOTIVE","required_date":null,"created_at":null,"updated_at":null}]
E/flutter (18089): [ERROR:flutter/runtime/dart_isolate.cc(717)] Isolate (398792005) 'main.dart:_spawn()' exited with an error
E/flutter (18089): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (18089): type 'String' is not a subtype of type 'int'
E/flutter (18089): #0 new Matl.fromJson (package:tams/model/material.dart:49:26)
E/flutter (18089): #1 parseMatl.<anonymous closure> (package:tams/services/material.dart:22:42)
E/flutter (18089): #2 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
E/flutter (18089): #3 ListIterable.toList (dart:_internal/iterable.dart:219:19)
E/flutter (18089): #4 parseMatl (package:tams/services/material.dart:22:58)
E/flutter (18089): #5 _IsolateConfiguration.apply (package:flutter/src/foundation/isolates.dart:88:16)
E/flutter (18089): #6 _spawn.<anonymous closure> (package:flutter/src/foundation/isolates.dart:96:30)
E/flutter (18089): #7 Timeline.timeSync (dart:developer/timeline.dart:168:22)
E/flutter (18089): #8 _spawn (package:flutter/src/foundation/isolates.dart:93:12)
E/flutter (18089): #9 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:292:17)
E/flutter (18089): #10 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
thanks.
i found it.
it because there is different json response from localhost and shared host
localhost
[{"id":10,"reservation":497538,"order":900000025301,"equipment":"F6U-EA112","matcode":6166357,"description":"GASKET:2JKT;HE2;1302X1342X3MM;NASB\/CS","q_need":1,"q_available":0,"q_debt":0,"unit":"EA","location":"","required_date":null,"created_at":null,"updated_at":null},{"id":11,"reservation":497538,"order":900000025301,"equipment":"F6U-EA112","matcode":6166345,"description":"GASKET:2JKT;HE1;1302X1342X3MM;NASB\/CS","q_need":1,"q_available":1,"q_debt":0,"unit":"EA","location":"GD AUTOMOTIVE","required_date":null,"created_at":null,"updated_at":null},{"id":27,"reservation":497566,"order":900000025329,"equipment":"F6U-FA112","matcode":6166298,"description":"GASKET,SPW:IOR;24IN;150LB;GR;304\/304\/CS","q_need":1,"q_available":0,"q_debt":0,"unit":"EA","location":"GD AUTOMOTIVE","required_date":null,"created_at":null,"updated_at":null}]
shared host
[{"id":10,"reservation":"497538","order":"900000025301","equipment":"F6U-EA112","matcode":"6166357","description":"GASKET:2JKT;HE2;1302X1342X3MM;NASB\/CS","q_need":"1","q_available":"0","q_debt":"0","unit":"EA","location":"","required_date":null,"created_at":null,"updated_at":null},{"id":11,"reservation":"497538","order":"900000025301","equipment":"F6U-EA112","matcode":"6166345","description":"GASKET:2JKT;HE1;1302X1342X3MM;NASB\/CS","q_need":"1","q_available":"1","q_debt":"0","unit":"EA","location":"GD AUTOMOTIVE","required_date":null,"created_at":null,"updated_at":null},{"id":27,"reservation":"497566","order":"900000025329","equipment":"F6U-FA112","matcode":"6166298","description":"GASKET,SPW:IOR;24IN;150LB;GR;304\/304\/CS","q_need":"1","q_available":"0","q_debt":"0","unit":"EA","location":"GD AUTOMOTIVE","required_date":null,"created_at":null,"updated_at":null}]