Flutter, simple method channel not working - flutter

I followed this https://docs.flutter.dev/development/platform-integration/platform-channels
D/InputTransport(12698): Input channel constructed: 'ClientS', fd=180
D/InputMethodManager(12698): prepareNavigationBarInfo() DecorView#9959d90[MainActivity]
D/InputMethodManager(12698): getNavigationBarColor() -16711423
V/InputMethodManager(12698): Starting input: tba=com.abc ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12698): startInputInner - Id : 0
I/SurfaceControl(12698): nativeRelease nativeObject s[-5476376642254367232]
I/SurfaceControl(12698): nativeRelease nativeObject e[-5476376642254367232]
I/SurfaceControl(12698): nativeRelease nativeObject s[-5476376642254367552]
I/SurfaceControl(12698): nativeRelease nativeObject e[-5476376642254367552]
continuously shows this.
The strange thing is that in Android project, clean project, rebuild, and turn off and restart Android studio sometimes works. (Only sometimes I can see the print("it works"); in MainActivity more specifically, inside of "configureFlutterEngine" function

Related

App stuck at black screen after upgraded from flutter 1.22.2 to flutter 2.5.3

After upgrading flutter, if I run the app from Android studio, I am consistently getting black screen. And If we create release bundle then opening the app and closing we are getting black screen 2 in 5 times.
And when shared the play console internal testing, after install and first open it is stuck at black screen and until user kills the app and reopen then it is opening. Even in this case also once in 3 times of closing and opening it is giving black screen.
2022-01-18 17:21:02.472 31430-31430/? I/lix.sample: Late-enabling -Xcheck:jni
2022-01-18 17:21:02.551 31430-31430/? I/lix.sample: Unquickening 26 vdex files!
2022-01-18 17:21:02.618 31430-31430/? D/ActivityThread: setConscryptValidator
2022-01-18 17:21:02.619 31430-31430/? D/ActivityThread: setConscryptValidator - put
2022-01-18 17:21:02.689 31430-31430/com.example.sample D/ActivityThread: handleBindApplication()++ app=com.example.sample
DEVICE | 0x78c683e3e0 | 0002 | RGBx_8888 | 0.0 480.0 2560.0 2080.0 | 0 0 2560 1600 | com.android.systemui.ImageWallpaper$_1872#0
2022-01-18 17:21:02.472 31430-31430/? I/lix.sample: Late-enabling -Xcheck:jni
2022-01-18 17:21:02.551 31430-31430/? I/lix.sample: Unquickening 26 vdex files!
2022-01-18 17:21:02.618 31430-31430/? D/ActivityThread: setConscryptValidator
2022-01-18 17:21:02.619 31430-31430/? D/ActivityThread: setConscryptValidator - put
2022-01-18 17:21:02.689 31430-31430/com.example.sample D/ActivityThread: handleBindApplication()++ app=com.example.sample
2022-01-18 17:21:02.472 31430-31430/? I/lix.sample: Late-enabling -Xcheck:jni
2022-01-18 17:21:02.551 31430-31430/? I/lix.sample: Unquickening 26 vdex files!
2022-01-18 17:21:02.618 31430-31430/? D/ActivityThread: setConscryptValidator
2022-01-18 17:21:02.619 31430-31430/? D/ActivityThread: setConscryptValidator - put
2022-01-18 17:21:02.689 31430-31430/com.example.sample D/ActivityThread: handleBindApplication()++ app=com.example.sample
2022-01-18 17:21:03.281 31430-31430/com.example.sample D/LoadedApk: LoadedApk::makeApplication() appContext=android.app.ContextImpl#ef78042 appContext.mOpPackageName=com.example.sample appContext.mBasePackageName=com.example.sample appContext.mPackageInfo=android.app.LoadedApk#d81e853
2022-01-18 17:21:03.282 31430-31430/com.example.sample D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
2022-01-18 17:21:03.330 31430-31430/com.example.sample D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
2022-01-18 17:21:03.392 31430-31430/com.example.sample I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2022-01-18 17:21:03.470 31430-31430/com.example.sample I/FirebaseInitProvider: FirebaseApp initialization successful
2022-01-18 17:21:03.472 31430-31430/com.example.sample D/FLTFireContextHolder: received application context.
2022-01-18 17:21:03.511 31430-31430/com.example.sample D/ActivityThread: handleBindApplication() -- skipGraphicsSupport=false
2022-01-18 17:21:03.529 31430-32714/com.example.sample I/ResourceExtractor: Found extracted resources res_timestamp-85-1642506494019
2022-01-18 17:21:03.529 31430-32714/com.example.sample I/ResourceExtractor: Resource version mismatch res_timestamp-85-1642506661529
2022-01-18 17:21:03.556 31430-31430/com.example.sample I/sampleTestBed: in Application class on create82a8af868409226a
2022-01-18 17:21:03.591 31430-32733/com.example.sample I/AdrenoGLES-0: QUALCOMM build : 4fb6cde, I78bcc4c05a
Build Date : 12/15/20
OpenGL ES Shader Compiler Version: EV031.32.02.06
Local Branch : mybrancheb3e9cd6-ca89-f13d-b631-08f1eafda2d0
Remote Branch : quic/gfx-adreno.lnx.1.0.r114-rel
Remote Branch : NONE
Reconstruct Branch : NOTHING
2022-01-18 17:21:03.591 31430-32733/com.example.sample I/AdrenoGLES-0: Build Config : S P 10.0.7 AArch64
2022-01-18 17:21:03.591 31430-32733/com.example.sample I/AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
2022-01-18 17:21:03.597 31430-32733/com.example.sample I/AdrenoGLES-0: PFP: 0x016ee190, ME: 0x00000000
2022-01-18 17:21:03.603 31430-31430/com.example.sample I/MainActivity: keys and data from intent
2022-01-18 17:21:03.604 31430-31430/com.example.sample I/MainActivity: data received from applink null app link action android.intent.action.MAINintent Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.sample/com.example.example.MainActivity }
2022-01-18 17:21:03.623 31430-31430/com.example.sample I/DecorView: [INFO] isPopOver=false, config=true
2022-01-18 17:21:03.623 31430-31430/com.example.sample I/DecorView: updateCaptionType >> DecorView#991b1d1[], isFloating=false, isApplication=true, hasWindowDecorCaption=false, hasWindowControllerCallback=true
2022-01-18 17:21:03.623 31430-31430/com.example.sample D/DecorView: setCaptionType = 0, this = DecorView#991b1d1[]
2022-01-18 17:21:03.638 31430-31430/com.example.sample I/BranchSDK: onActivityCreated, activity = com.example.example.MainActivity#ed5bdc2
2022-01-18 17:21:04.418 31430-32714/com.example.sample I/ResourceExtractor: Extracted baseline resource assets/flutter_assets/kernel_blob.bin
2022-01-18 17:21:04.420 31430-32714/com.example.sample I/ResourceExtractor: Extracted baseline resource assets/flutter_assets/vm_snapshot_data
2022-01-18 17:21:04.464 31430-32714/com.example.sample I/ResourceExtractor: Extracted baseline resource assets/flutter_assets/isolate_snapshot_data
2022-01-18 17:21:04.601 31430-31430/com.example.sample I/WebViewFactory: Loading com.google.android.webview version 97.0.4692.87 (code 469208733)
2022-01-18 17:21:04.630 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (greylist, reflection, allowed)
2022-01-18 17:21:04.630 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (greylist, reflection, allowed)
2022-01-18 17:21:04.630 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (greylist, reflection, allowed)
2022-01-18 17:21:04.630 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (greylist, reflection, allowed)
2022-01-18 17:21:04.630 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (greylist, reflection, allowed)
2022-01-18 17:21:04.633 31430-31430/com.example.sample I/cr_WVCFactoryProvider: Loaded version=97.0.4692.87 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
2022-01-18 17:21:04.662 31430-31430/com.example.sample I/cr_LibraryLoader: Successfully loaded native library
2022-01-18 17:21:04.663 31430-31430/com.example.sample I/cr_CachingUmaRecorder: Flushed 8 samples from 8 histograms.
2022-01-18 17:21:04.670 31430-31430/com.example.sample I/TetheringManager: registerTetheringEventCallback:com.example.sample
2022-01-18 17:21:04.670 31430-31430/com.example.sample D/ConnectivityManager: ConnectivityManager() mContext=com.example.example.BranchApplicationClass#efa180c getOpPackageName()=com.example.sample getBasePackageName()=com.example.sample getPackageName()=com.example.sample
2022-01-18 17:21:04.740 31430-613/com.example.sample I/flutter: Observatory listening on http://127.0.0.1:34591/BoFcuBcmvWM=/
2022-01-18 17:21:04.819 31430-31430/com.example.sample D/PathProviderPlugin: Don't use TaskQueues.
2022-01-18 17:21:04.855 31430-31430/com.example.sample I/TextToSpeech: Sucessfully bound to com.samsung.SMT
2022-01-18 17:21:04.888 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (greylist,test-api, reflection, allowed)
2022-01-18 17:21:04.888 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (greylist, reflection, allowed)
2022-01-18 17:21:04.888 31430-31430/com.example.sample W/lix.sample: Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (greylist, reflection, allowed)
2022-01-18 17:21:04.888 31430-31430/com.example.sample W/lix.sample: Accessing hidden method Landroid/util/LongArray;->get(I)J (greylist, reflection, allowed)
2022-01-18 17:21:04.904 31430-31430/com.example.sample I/BranchSDK: onActivityStarted, activity = com.example.example.MainActivity#ed5bdc2
2022-01-18 17:21:04.909 31430-31430/com.example.sample I/MainActivity: data from intent null
2022-01-18 17:21:04.910 31430-31430/com.example.sample I/BranchSDK: Warning: You are using your test app's Branch Key. Remember to change it to live Branch Key during deployment.
2022-01-18 17:21:04.941 31430-31430/com.example.sample I/BranchSDK: onActivityResumed, activity = com.example.example.MainActivity#ed5bdc2
2022-01-18 17:21:04.969 31430-31430/com.example.sample D/InputTransport: Input channel constructed: 'ac866f0', fd=152
2022-01-18 17:21:04.975 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: setView = com.android.internal.policy.DecorView#991b1d1 TM=true
2022-01-18 17:21:05.028 31430-31430/com.example.sample I/SurfaceControl: assignNativeObject: nativeObject = 0 Surface(name=null)/#0xc29ff13 / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9130 android.view.ViewRootImpl.performTraversals:3420 android.view.ViewRootImpl.doTraversal:2669 android.view.ViewRootImpl$TraversalRunnable.run:10092 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
2022-01-18 17:21:05.032 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: Relayout returned: old=(0,0,1600,2560) new=(0,0,1600,2560) req=(1600,2560)0 dur=19 res=0x7 s={true 505099329536} ch=true fn=-1
2022-01-18 17:21:05.040 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11078 android.view.ViewRootImpl.performTraversals:3915 android.view.ViewRootImpl.doTraversal:2669
2022-01-18 17:21:05.040 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: [DP] pd() Asnyc report
2022-01-18 17:21:05.041 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: mAttachInfo.mThreadedRenderer.draw, mView = DecorView#991b1d1[MainActivity] w = 1600 h = 2560
2022-01-18 17:21:06.108 31430-32733/com.example.sample I/Gralloc4: mapper 4.x is not supported
2022-01-18 17:21:06.109 31430-32733/com.example.sample W/Gralloc3: mapper 3.x is not supported
2022-01-18 17:21:06.147 31430-32733/com.example.sample I/OpenGLRenderer: Davey! duration=1169ms; Flags=1, IntendedVsync=958650888198330, Vsync=958650904864996, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=958650906882843, AnimationStart=958650906893780, PerformTraversalsStart=958650906900499, DrawStart=958650952542113, SyncQueued=958651991816332, SyncStart=958651992435290, IssueDrawCommandsStart=958651992788363, SwapBuffers=958652055637373, FrameCompleted=958652058430394, DequeueBufferDuration=25025677, QueueBufferDuration=1090052, GpuCompleted=0,
2022-01-18 17:21:06.160 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4743 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938
2022-01-18 17:21:06.160 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: [DP] rdf()
2022-01-18 17:21:06.164 31430-31430/com.example.sample I/Choreographer: Skipped 71 frames! The application may be doing too much work on its main thread.
2022-01-18 17:21:06.191 31430-31430/com.example.sample I/TextToSpeech: Connected to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
2022-01-18 17:21:06.193 31430-31430/com.example.sample I/ViewRootImpl#8ee4c76[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2022-01-18 17:21:06.194 31430-31430/com.example.sample D/InputMethodManager: prepareNavigationBarInfo() DecorView#991b1d1[MainActivity]
2022-01-18 17:21:06.194 31430-31430/com.example.sample D/InputMethodManager: getNavigationBarColor() -855310
2022-01-18 17:21:06.196 31430-31430/com.example.sample D/InputMethodManager: prepareNavigationBarInfo() DecorView#991b1d1[MainActivity]
2022-01-18 17:21:06.196 31430-31430/com.example.sample D/InputMethodManager: getNavigationBarColor() -855310
2022-01-18 17:21:06.196 31430-32714/com.example.sample I/TextToSpeech: Set up connection to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
2022-01-18 17:21:06.196 31430-31430/com.example.sample V/InputMethodManager: Starting input: tba=com.example.sample ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2022-01-18 17:21:06.197 31430-31430/com.example.sample D/InputMethodManager: startInputInner - Id : 0
2022-01-18 17:21:06.197 31430-31430/com.example.sample I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2022-01-18 17:21:06.197 31430-32723/com.example.sample I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2022-01-18 17:21:06.198 31430-32723/com.example.sample I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2022-01-18 17:21:06.205 31430-32612/com.example.sample D/InputTransport: Input channel constructed: 'ClientS', fd=161
2022-01-18 17:21:06.231 31430-31430/com.example.sample D/InputMethodManager: prepareNavigationBarInfo() DecorView#991b1d1[MainActivity]
2022-01-18 17:21:06.231 31430-31430/com.example.sample D/InputMethodManager: getNavigationBarColor() -855310
2022-01-18 17:21:06.231 31430-31430/com.example.sample V/InputMethodManager: Starting input: tba=com.example.sample ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2022-01-18 17:21:06.232 31430-31430/com.example.sample D/InputMethodManager: startInputInner - Id : 0
2022-01-18 17:21:06.235 31430-31430/com.example.sample I/SurfaceControl: nativeRelease nativeObject s[503463222464]
2022-01-18 17:21:06.235 31430-31430/com.example.sample I/SurfaceControl: nativeRelease nativeObject e[503463222464]
2022-01-18 17:21:06.235 31430-31430/com.example.sample I/SurfaceControl: nativeRelease nativeObject s[503463221504]
2022-01-18 17:21:06.235 31430-31430/com.example.sample I/SurfaceControl: nativeRelease nativeObject e[503463221504]
2022-01-18 17:21:06.240 31430-564/com.example.sample I/flutter: Log.INFO : in checkAndHandleLocalNotificationOnLaunch
2022-01-18 17:21:06.284 31430-31430/com.example.sample W/FlutterJNI: FlutterJNI.setRefreshRateFPS called more than once
2022-01-18 17:21:06.286 31430-761/com.example.sample W/FlutterJNI: FlutterJNI.loadLibrary called more than once
2022-01-18 17:21:06.287 31430-32714/com.example.sample I/ResourceExtractor: Found extracted resources res_timestamp-85-1642506661529
2022-01-18 17:21:06.288 31430-763/com.example.sample W/FlutterJNI: FlutterJNI.prefetchDefaultFontManager called more than once
2022-01-18 17:21:06.291 31430-31430/com.example.sample W/FlutterJNI: FlutterJNI.init called more than once
2022-01-18 17:21:06.292 31430-31430/com.example.sample I/FLTFireBGExecutor: Creating background FlutterEngine instance, with args: []
2022-01-18 17:21:06.308 31430-31430/com.example.sample D/PathProviderPlugin: Don't use TaskQueues.
2022-01-18 17:21:06.319 31430-31430/com.example.sample I/TextToSpeech: Sucessfully bound to com.samsung.SMT
2022-01-18 17:21:06.337 31430-31430/com.example.sample I/TextToSpeech: Connected to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
2022-01-18 17:21:06.342 31430-32714/com.example.sample I/TextToSpeech: Set up connection to ComponentInfo{com.samsung.SMT/com.samsung.SMT.SamsungTTSService}
EDIT:
One more observation I found is, if I declare splashscreen drawable in manifest file, then the splash screen is coming up and then immediately black screen is coming and the app is stuck.
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_drawable" />
UPDATE:
After day of debugging and narrowing it down, finally found the culprit. This was present in MainActivity.java, apparently it was added to handle the black screen in older versions of flutter, but now this lead to complete stuck.
#NonNull
#Override
protected FlutterActivityLaunchConfigs.BackgroundMode getBackgroundMode() {
return FlutterActivityLaunchConfigs.BackgroundMode.transparent;
}

VideoPlayer becomes black when dismissing a miniplayer in Flutter

I have a miniplayer where I have a video widget (I use better_player which depends on chewie and video_player). Everything works great unless I want to dismiss the miniplayer. The video is replaced with a black screen. I did some debugging and found out that for some reason the dispose() method is called on my video_widget twice (when I start dismissing and when I end dismissing my miniplayer). Below is a video that shows this behavior:
Could you help me with fixing this issue?
EDIT
I did some more debugging and found out that it is probably related to the video widget or better_player package. Also, I found out that when using chewie behavior is nearly the same but with chewie when I start dismissing video gets black for a millisecond and then initializes again and starts playing from the beginning. Here is the code of my `video widget class.
import 'dart:io';
import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter/services.dart';
import 'package:cook_it/screens/longs_page/providers/providers.dart';
import 'package:path_provider/path_provider.dart';
import 'package:better_player/better_player.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class LongsVideoItem extends StatefulWidget {
const LongsVideoItem({Key? key }) : super(key: key);
#override
_LongsVideoItemState createState() => _LongsVideoItemState();
}
class _LongsVideoItemState extends State<LongsVideoItem> {
void _toggleVideoControls(bool show){
if (show){
_betterPlayerController.setControlsEnabled(true);
}else{
_betterPlayerController.setControlsEnabled(false);
}
}
Future _saveAssetVideoToFile() async {
final content = await rootBundle.load("assets/videos/second.mp4");
final directory = await getApplicationDocumentsDirectory();
final file = File("${directory.path}/second.mp4");
_directory = "${directory.path}/second.mp4";
file.writeAsBytesSync(content.buffer.asUint8List());
}
BetterPlayerController _betterPlayerController = BetterPlayerController(const BetterPlayerConfiguration());
dynamic _directory;
#override
void initState() {
_saveAssetVideoToFile().then((value) {
final BetterPlayerDataSource betterPlayerDataSource = BetterPlayerDataSource(
BetterPlayerDataSourceType.file,
_directory.toString(),
);
_betterPlayerController = BetterPlayerController(
const BetterPlayerConfiguration(
deviceOrientationsAfterFullScreen: [DeviceOrientation.portraitUp],
aspectRatio: 16/9,
autoPlay: true,
controlsConfiguration: BetterPlayerControlsConfiguration(showControlsOnInitialize: false),
),
betterPlayerDataSource: betterPlayerDataSource,
);
});
super.initState();
}
#override
void dispose() {
super.dispose();
}
#override
Widget build(BuildContext context) {
return Consumer(
builder: (context, watch, _){
if (watch(videoShowControlsProvider).state == true){
_toggleVideoControls(true);
}else if (watch(videoShowControlsProvider).state == false){
_toggleVideoControls(false);
}
return BetterPlayer(controller: _betterPlayerController,);
}
);
}
}
here are the logs when I start dismissing
I/ExoPlayerImpl(16667): Release cd87770 [ExoPlayerLib/2.14.1] [HWCLT, CLT-L29, HUAWEI, 28] [goog.exo.core]
W/ACodec (16667): forcing OMX state to Idle when received shutdown in ExecutingState
3
E/BufferQueueProducer(16667): [SurfaceTexture-0-16667-145] cancelBuffer: BufferQueue has been abandoned
I/chatty (16667): uid=10234(com.example.cook_it) JNISurfaceTextu identical 10 lines
E/BufferQueueProducer(16667): [SurfaceTexture-0-16667-145] cancelBuffer: BufferQueue has been abandoned
D/SurfaceUtils(16667): disconnecting from surface 0x797bec7010, reason disconnectFromSurface
I/ExoPlayerImpl(16667): Init 8b84e21 [ExoPlayerLib/2.14.1] [HWCLT, CLT-L29, HUAWEI, 28]
V/AudioManager(16667): getStreamVolume treamType: 3
V/AudioManager(16667): isStreamMute streamType: 3
V/AudioManager(16667): getStreamMaxVolume treamType: 3
E/ (16667): [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
I/OMXClient(16667): IOmx service obtained
I/ACodec (16667): In onAllocateComponent create compenent, codec name: OMX.hisi.video.decoder.avc
D/SurfaceUtils(16667): connecting to surface 0x797c027010, reason connectToSurface
I/MediaCodec(16667): [OMX.hisi.video.decoder.avc] setting surface generation to 17067154
D/SurfaceUtils(16667): disconnecting from surface 0x797c027010, reason connectToSurface(reconnect)
D/SurfaceUtils(16667): connecting to surface 0x797c027010, reason connectToSurface(reconnect)
E/ACodec (16667): [OMX.hisi.video.decoder.avc] setPortMode on output to DynamicANWBuffer failed w/ err -2147483648
I/HwExtendedCodec(16667): mime is [video/avc] at setVideoFormat
I/ACodec (16667): codec does not support config priority (err -22)
2
I/ACodec (16667): [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
I/ACodec (16667): [OMX.hisi.video.decoder.avc] using color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) and dataspace 0x104
I/ACodec (16667): onStart
D/SurfaceUtils(16667): disconnecting from surface 0x797c027010, reason setNativeWindowSizeFormatAndUsage
D/SurfaceUtils(16667): connecting to surface 0x797c027010, reason setNativeWindowSizeFormatAndUsage
D/SurfaceUtils(16667): set up nativeWindow 0x797c027010 for 1920x1080, color 0x30d, rotation 0, usage 0x20002900
6
W/MapperHal(16667): buffer descriptor with invalid usage bits 0x2000
2
I/ACodec (16667): [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
I/ACodec (16667): [OMX.hisi.video.decoder.avc] using color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) and dataspace 0x104
2
I/ACodec (16667): [OMX.hisi.video.decoder.avc] got color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) err=0(NO_ERROR)
I/ACodec (16667): [OMX.hisi.video.decoder.avc] using color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) and dataspace 0x104
D/SurfaceUtils(16667): disconnecting from surface 0x797c027010, reason setNativeWindowSizeFormatAndUsage
D/SurfaceUtils(16667): connecting to surface 0x797c027010, reason setNativeWindowSizeFormatAndUsage
D/SurfaceUtils(16667): set up nativeWindow 0x797c027010 for 1920x1088, color 0x30d, rotation 0, usage 0x20002900
W/ACodec (16667): [OMX.hisi.video.decoder.avc] setting nBufferCountActual to 19 failed: -2147483648
18
W/MapperHal(16667): buffer descriptor with invalid usage bits 0x2000
I/ACodec (16667): date space update : 0x104
I believe that for some reason this widget calls the dispose() method when I start dismissing. But why is that happening and how can I prevent that from happening?
I found the answer. The problem was in the miniplayer package. In case someone has the same problem comment here and I will explain how to fix it.

flutter-keyboard hides itself when clicked on textfield

I/ViewRootImpl#799941b[MainActivity](12513): ViewPostIme pointer 0
I/ViewRootImpl#799941b[MainActivity](12513): ViewPostIme pointer 1
D/InputMethodManager(12513): SSI - flag : 0 Pid : 12513 view : com.example.facatte
D/InputMethodManager(12513): prepareNavigationBarInfo() DecorView#f0b7259[MainActivity]
D/InputMethodManager(12513): getNavigationBarColor() -855310
D/InputMethodManager(12513): prepareNavigationBarInfo() DecorView#f0b7259[MainActivity]
D/InputMethodManager(12513): getNavigationBarColor() -855310
V/InputMethodManager(12513): Starting input: tba=com.example.facatte ic=io.flutter.plugin.editing.InputConnectionAdaptor#8b758fe mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(12513): startInputInner - Id : 0
I/InputMethodManager(12513): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(12513): Input channel destroyed: 'ClientS', fd=93
W/IInputConnectionWrapper(12513): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12513): requestCursorAnchorInfo on inactive InputConnection
I/ViewRootImpl#799941b[MainActivity](12513): MSG_RESIZED: frame=(0,0,1080,2340) ci=(0,83,0,989) vi=(0,83,0,989) or=1
I/ViewRootImpl#799941b[MainActivity](12513): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=12 res=0x1 s={true 518951051264} ch=false
D/InputMethodManager(12513): HSIFW - flag : 0
I/ViewRootImpl#799941b[MainActivity](12513): MSG_RESIZED: frame=(0,0,1080,2340) ci=(0,83,0,126) vi=(0,83,0,126) or=1
I/ViewRootImpl#799941b[MainActivity](12513): Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) req=(1080,2340)0 dur=12 res=0x1 s={true 518951051264} ch=false
This is the output in console when tapping on the textfield.
The keyboard comes up for 2 seconds and then hides automatically. It doesnt throw any error too !
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final _formKey = GlobalKey<FormState>();
TextEditingController textEditingController = new TextEditingController();
return Scaffold(
key: _scaffoldKey,
body : Form(
key: _formKey,
child: TextField(
controller: textEditingController,
decoration: new InputDecoration(
hintText: 'Type Your Data',
),
),
));
Or If you are using Multiple TextFields then use a separate controller for each TextField. I hope this will work for you.

contact picker causing app crash after I am selecting contact from contact list

I am using Flutter contact picker 0.0.2. But it is giving some weird error. It shows the contact list when I call selectContact Future, however, after selecting a particular contact from the list, the app crashes, and it gives me the below-mentioned error on console.
I have also tried with adding permission in android, even though it is not required, still, it does not work.
Code :
class _MobileNumberWidgetState extends State<MobileNumberWidget> {
final TextEditingController _phoneNumberController = TextEditingController();
final ContactPicker _contactPicker = new ContactPicker();
Contact _contact;
#override
Widget build(BuildContext context) {
return AppWidgets.shadowContainerComplete(
child:Row(
children: <Widget>[
Expanded(
child: TextField(
controller: _phoneNumberController,
decoration: AppStyles.textField(hint: "Enter Phone Number", iconData: Icons.phone_iphone),
),
),
IconButton(
icon: Icon(Icons.format_list_numbered),
onPressed: () async{
Contact contact = await _contactPicker.selectContact();
setState(() {
_contact = contact;
});
},
)
],
)
);
}
}
Console :
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
D/FlutterActivity(17398): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(17398): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(17398): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
D/FlutterActivityAndFragmentDelegate(17398): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView(17398): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine#43c3a74
D/FlutterActivityAndFragmentDelegate(17398): Executing Dart entrypoint: main, and sending initial route: /
Debug service listening on ws://127.0.0.1:28145/jPIcHt_yF9E=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation(17398): eglMakeCurrent: 0xe121a6c0: ver 3 1 (tinfo 0xe120f8a0)
D/eglCodecCommon(17398): setVertexArrayObject: set vao to 0 (0) 1 0
D/EGL_emulation(17398): eglMakeCurrent: 0xe121a180: ver 3 1 (tinfo 0xe120fa70)
D/FlutterView(17398): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine#43c3a74
D/AndroidRuntime(17398): Shutting down VM
E/AndroidRuntime(17398): FATAL EXCEPTION: main
E/AndroidRuntime(17398): Process: maaz.easyapproach.kashbak, PID: 17398
E/AndroidRuntime(17398): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2015, result=-1, data=Intent { dat=content://com.android.contacts/data/1 flg=0x1 }} to activity {maaz.easyapproach.kashbak/maaz.easyapproach.kashbak.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.app.Activity.getContentResolver()' on a null object reference
E/AndroidRuntime(17398): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(17398): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(17398): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(17398): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(17398): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(17398): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(17398): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(17398): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(17398): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17398): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(17398): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.app.Activity.getContentResolver()' on a null object reference
E/AndroidRuntime(17398): at net.goderbauer.flutter.contactpicker.ContactPickerPlugin.onActivityResult(ContactPickerPlugin.java:68)
E/AndroidRuntime(17398): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634)
E/AndroidRuntime(17398): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367)
E/AndroidRuntime(17398): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546)
E/AndroidRuntime(17398): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594)
E/AndroidRuntime(17398): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime(17398): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(17398): ... 11 more
I/Process (17398): Sending signal. PID: 17398 SIG: 9
Lost connection to device.

Too many logs in flutter app when touch on screen

i have created new project in flutter and not added any single line in that default project still
it displays logs every time i touch on screen.
i think it is because of android 10 device.
anyone have any idea?
it gives below log every time i touch on screen
D/ColorViewRootUtil(29111): nav gesture mode swipeFromBottom ignore false downY 1325 mScreenHeight 2340 mScreenWidth 1080 mStatusBarHeight 54 globalScale 1.125 nav mode 3 event MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=425.0, y[0]=1325.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=11694678, downTime=11694678, deviceId=7, source=0x1002, displayId=0 } rotation 0
if you are using flutter sdk version v1.12.13+hotfix.8 you may face this issue because it is not stable.