Description
Video Reference : https://www.youtube.com/shorts/NDc94vCfTSQ
Package: flutter_embed_unity
Version: ^1.2.5
Platform: Android
Unity Version: 2022.3.62f1
Flutter Version:
Flutter 3.22.3 • stable channel
Framework • revision 6b2043a (4 days ago)
Engine • revision d4636b
Tools • Dart 3.3.3
in my app in my main category i have these activities knee,shoulder,backpain,neck,elbow,examine,stroke and posture
📝 Description
I’m using the flutter_embed_unity package to render Unity within my Flutter app. I’ve categorized my app into multiple activities like:
knee, shoulder, backpain, neck, elbow, examine, stroke, and posture.
❌ Issue
When Unity is opened for the first time from any activity, a white screen is shown.
From the second time onwards, Unity renders correctly in most activities.
But for posture activity, Unity never renders—always stuck at a white screen.
📱 Device Info
Android SDK Version: 36.0.0-rc3
Device orientation: Landscape
Device resolution: 1080x2400 (rotated)
✅ Expected Behavior
Unity should render properly the first time the activity is opened.
Unity should work consistently across all activities, including posture.
The log showing is for when activity first time opening time on the white screen:
W/VRI[MainActivity](18388): handleResized, msg:5, frameChanged:true, configChanged:true, displayChanged:false, attachedFrameChanged:false, compatScaleChanged:false, pendingDragResizing=false
D/ResourcesManagerExtImpl(18388): applyConfigurationToAppResourcesLocked app.getDisplayId() return callback.displayId:0
I/Quality (18388): Skipped: false 1 cost 16.922745 refreshRate 16543320 bit true processName com.metafocuz.replay
D/ViewRootImplExtImpl(18388): wrapConfigInfoIntoFlags rotation=1, smallestScreenWidthDp=424, relayoutAsync=false, newFlags=256, title=com.metafocuz.replay/com.metafocuz.replay.MainActivity
D/VRI[MainActivity](18388): relayoutWindow result, sizeChanged:true, surfaceControlChanged:false, transformHintChanged:true, mSurfaceSize:Point(2292, 1080), mLastSurfaceSize:Point(1080, 2400), mWidth:1080, mHeight:2400, requestedWidth:2292, requestedHeight:1080, transformHint:4, lastTransformHint:0, installOrientation:0, displayRotation:1, isSurfaceValid:true, attr.flag:-2122252032, useBlast:true, tmpFrames:ClientWindowFrames{frame=[108,0][2400,1080] display=[108,0][2400,1080] #parentFrame=[0,0][0,0]}
D/BufferQueueProducer(18388): [VRI[MainActivity]#0(BLAST Consumer)0](id:47d400000000,api:1,p:18388,c:18388) connect: api=1 producerControlledByApp=true
E/OpenGLRenderer(18388): Unable to match the desired swap behavior.
D/BufferQueueProducer(18388): [SurfaceView[com.metafocuz.replay/com.metafocuz.replay.MainActivity]#1(BLAST Consumer)1](id:47d400000001,api:1,p:18388,c:18388) disconnect: api 1
D/BufferQueueProducer(18388): [SurfaceView[com.metafocuz.replay/com.metafocuz.replay.MainActivity]#1(BLAST Consumer)1](id:47d400000001,api:1,p:18388,c:18388) connect: api=1 producerControlledByApp=true
D/SurfaceView(18388): 47454887 handleSyncNoBuffer
D/SurfaceView(18388): 47454887 finishedDrawing
D/SurfaceView(18388): 47454887 performDrawFinished mAttachedToWindow true
I/SurfaceControl(18388): setExtendedRangeBrightness sc=Surface(name=com.metafocuz.replay/com.metafocuz.replay.MainActivity)/@0x96a0cb5,currentBufferRatio=1.0,desiredRatio=1.0
D/SurfaceView(18388): 47454887 dispatchDraw mDrawFinished true isAboveParent false (mPrivateFlags & PFLAG_SKIP_DRAW) 128
D/SurfaceView(18388): 47454887 clearSurfaceViewPort mCornerRadius 0.0
D/BLASTBufferQueue(18388): [VRI[MainActivity]#0](f:0,a:3) producer disconnected before acquireNextBufferLocked
D/VRI[MainActivity](18388): Received frameCommittedCallback lastAttemptedDrawFrameNum=43 didProduceBuffer=true syncBuffer=false
D/VRI[MainActivity](18388): draw finished.
D/VRI[MainActivity](18388): reportDrawFinished
D/callGcSupression(18388): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference
D/ViewRootImplExtImpl(18388): wrapConfigInfoIntoFlags rotation=1, smallestScreenWidthDp=424, relayoutAsync=true, newFlags=256, title=com.metafocuz.replay/com.metafocuz.replay.MainActivity
D/VRI[MainActivity](18388): relayoutWindow result, sizeChanged:false, surfaceControlChanged:false, transformHintChanged:false, mSurfaceSize:Point(2292, 1080), mLastSurfaceSize:Point(2292, 1080), mWidth:2292, mHeight:1080, requestedWidth:2292, requestedHeight:1080, transformHint:4, lastTransformHint:4, installOrientation:0, displayRotation:1, isSurfaceValid:true, attr.flag:-2122252032, useBlast:true, tmpFrames:ClientWindowFrames{frame=[108,0][2400,1080] display=[108,0][2400,1080] parentFrame=[108,0][2400,1080] parentClippedByDisplayCutout}
W/VRI[MainActivity](18388): updateBlastSurfaceIfNeeded, surfaceSize:Point(2292, 1080), lastSurfaceSize:Point(2292, 1080), format:-3, blastBufferQueue:android.graphics.BLASTBufferQueue@867b86f
I/flutter (18388): height**********************423.5294196844927
I/flutter (18388): width423.5294196844927
D/BufferQueueProducer(18388): [SurfaceView[com.metafocuz.replay/com.metafocuz.replay.MainActivity]#1(BLAST Consumer)1](id:47d400000001,api:1,p:18388,c:18388) disconnect: api 1
D/BufferQueueProducer(18388): [SurfaceView[com.metafocuz.replay/com.metafocuz.replay.MainActivity]#1(BLAST Consumer)1](id:47d400000001,api:1,p:18388,c:18388) connect: api=1 producerControlledByApp=truesc=Surface(name=com.metafocuz.replay/com.metafocuz.replay.MainActivity)/@0x96a0cb5,currentBufferRatio=1.0,desiredRatio=1.0
D/SurfaceView(18388): 47454887 dispatchDraw mDrawFinished true isAboveParent false (mPrivateFlags & PFLAG_SKIP_DRAW) 128
D/SurfaceView(18388): 47454887 clearSurfaceViewPort mCornerRadius 0.0
W/VRI[MainActivity](18388): handleResized abandoned!
D/com.learntoflutter.flutter_embed_unity_android.platformView.UnityViewFactory@16a5498(18388): UnityViewFactory creating view 0
D/nativeloader(18388): Load /data/app/~~B7VqRai53NXXEG2xUj5sbw==/com.metafocuz.replay-RONpoWXQklY4WPzrXJhAzA==/lib/arm64/libmain.so using ns clns-7 from class loader (caller=/data/app/~~B7VqRai53NXXEG2xUj5sbw==/com.metafocuz.replay-RONpoWXQklY4WPzrXJhAzA==/base.apk): ok
I/flutter (18388): height**********************423.5294196844927
I/flutter (18388): width423.5294196844927
I/IL2CPP (18388): JNI_OnLoad
I/FlutterEmbedLog(18388): Attached Unity to view
W/WindowOnBackDispatcher(18388): sendCancelIfRunning: isInProgress=falsecallback=com.unity3d.player.d@b899757
D/AudioManagerExtImpl(18388): getStreamVolume packageName=com.metafocuz.replay, index=5, streamType=3
I/FlutterEmbedLog(18388): Attached Unity to new view
D/FlutterEmbedLog(18388): UnityPlatformView onFlutterViewAttached
I/PlatformViewsController(18388): Hosting view in a virtual display for platform view: 0
I/PlatformViewsController(18388): PlatformView is using ImageReader backend
D/CompatibilityChangeReporter(18388): Compat change id reported: 236825255; UID 10376; state: ENABLED
D/BufferQueueConsumer(18388): [](id:47d400000002,api:0,p:-1,c:18388) connect: controlledByApp=true
D/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) connect: api=1 producerControlledByApp=falsesc=Surface(name=com.metafocuz.replay/com.metafocuz.replay.MainActivity)/@0x96a0cb5,currentBufferRatio=1.0,desiredRatio=1.0
E/OplusBracketLog(18388): [OplusViewMirrorManager] updateHostViewRootIfNeeded, not support android.view.ViewRootImpl@f4f8d9d
D/FlutterEmbedLog(18388): UnityPlayerSingleton onWindowVisibilityChanged 0
D/FlutterEmbedLog(18388): UnityPlayerSingleton became visible, so pausing and resuming Unity
W/WindowOnBackDispatcher(18388): sendCancelIfRunning: isInProgress=falsecallback=com.unity3d.player.d@7637f2d
D/AudioManagerExtImpl(18388): getStreamVolume packageName=com.metafocuz.replay, index=5, streamType=3
I/SurfaceView(18388): 199988192 onAttachedToWindow
D/ViewRootImplExtImpl(18388): wrapConfigInfoIntoFlags rotation=0, smallestScreenWidthDp=424, relayoutAsync=false, newFlags=27787264, title=
W/VRI[] (18388): updateBlastSurfaceIfNeeded, surfaceSize:Point(2180, 1080), lastSurfaceSize:Point(0, 0), format:-2, blastBufferQueue:null
D/BufferQueueConsumer(18388): [](id:47d400000003,api:0,p:-1,c:18388) connect: controlledByApp=false
D/BufferQueueProducer(18388): [VRI[]#2(BLAST Consumer)2](id:47d400000003,api:1,p:18388,c:18388) connect: api=1 producerControlledByApp=true
E/OpenGLRenderer(18388): Unable to match the desired swap behavior.
D/BufferQueueConsumer(18388): [](id:47d400000004,api:0,p:-1,c:18388) connect: controlledByApp=false
I/SurfaceView(18388): 199988192 visibleChanged -- surfaceCreated
D/SurfaceView(18388): 199988192 handleSyncNoBuffer
D/SurfaceView(18388): 199988192 finishedDrawing
D/SurfaceView(18388): 199988192 performDrawFinished mAttachedToWindow true
I/SurfaceControl(18388): setExtendedRangeBrightness sc=Surface(name=)/@0x98c353f,currentBufferRatio=1.0,desiredRatio=1.0
D/SurfaceView(18388): 199988192 dispatchDraw mDrawFinished true isAboveParent false (mPrivateFlags & PFLAG_SKIP_DRAW) 128
D/SurfaceView(18388): 199988192 clearSurfaceViewPort mCornerRadius 0.0
D/BLASTBufferQueue(18388): [VRI[]#2](f:0,a:1) acquireNextBufferLocked size=2180x1080 mFrameNumber=1 applyTransaction=true mTimestamp=100421661297680(auto) mPendingTransactions.size=0 graphicBufferId=78975858638865 transform=0
D/VRI[] (18388): Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true syncBuffer=false
D/VRI[] (18388): draw finished.
D/VRI[] (18388): reportDrawFinished
D/ViewRootImplExtImpl(18388): setMaxDequeuedBufferCount: 2
I/Quality (18388): Skipped: false 1 cost 31.597044 refreshRate 16546238 bit true processName com.metafocuz.replay
D/BufferQueueConsumer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) disconnect
D/BufferQueueConsumer(18388): [](id:47d400000005,api:0,p:-1,c:18388) connect: controlledByApp=true
W/VRI[] (18388): handleResized, msg:5, frameChanged:false, configChanged:false, displayChanged:false, attachedFrameChanged:false, compatScaleChanged:false, pendingDragResizing=false
D/VRI[] (18388): Received frameCommittedCallback lastAttemptedDrawFrameNum=2 didProduceBuffer=true syncBuffer=false
I/Unity (18388): MemoryManager: Using 'Dynamic Heap' Allocator.
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
W/etafocuz.replay(18388): Accessing hidden method Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V (unsupported, reflection, allowed)
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
W/VRI[] (18388): handleResized, msg:5, frameChanged:true, configChanged:true, displayChanged:false, attachedFrameChanged:false, compatScaleChanged:false, pendingDragResizing=false
D/ViewRootImplExtImpl(18388): wrapConfigInfoIntoFlags rotation=0, smallestScreenWidthDp=424, relayoutAsync=false, newFlags=27787264, title=
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
I/Unity (18388): SystemInfo CPU = ARM64, Cores = 8, Memory = 7271mb
I/Unity (18388): SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
W/VRI[] (18388): updateBlastSurfaceIfNeeded, surfaceSize:Point(2292, 1080), lastSurfaceSize:Point(2180, 1080), format:-2, blastBufferQueue:android.graphics.BLASTBufferQueue@cbaa91a
I/Unity (18388): ApplicationInfo com.metafocuz.replay version 1.1.19
I/Unity (18388): Built from '2022.3/staging' branch, Version '2022.3.62f1 (4af31df58517)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a', Stripping 'Disabled'
D/SurfaceView(18388): 199988192 handleSyncNoBuffer
D/BufferQueueProducer(18388): [VRI[]#2(BLAST Consumer)2](id:47d400000003,api:1,p:18388,c:18388) disconnect: api 1
D/BufferQueueProducer(18388): [VRI[]#2(BLAST Consumer)2](id:47d400000003,api:1,p:18388,c:18388) connect: api=1 producerControlledByApp=true
E/OpenGLRenderer(18388): Unable to match the desired swap behavior.
D/SurfaceView(18388): 199988192 finishedDrawing
D/SurfaceView(18388): 199988192 performDrawFinished mAttachedToWindow true
I/SurfaceControl(18388): setExtendedRangeBrightness sc=Surface(name=)/@0x98c353f,currentBufferRatio=1.0,desiredRatio=1.0
D/SurfaceView(18388): 199988192 dispatchDraw mDrawFinished true isAboveParent false (mPrivateFlags & PFLAG_SKIP_DRAW) 128
D/SurfaceView(18388): 199988192 clearSurfaceViewPort mCornerRadius 0.0
D/BLASTBufferQueue(18388): [VRI[]#2](f:0,a:3) producer disconnected before acquireNextBufferLocked
D/VRI[] (18388): Received frameCommittedCallback lastAttemptedDrawFrameNum=3 didProduceBuffer=true syncBuffer=false
D/VRI[] (18388): draw finished.
D/VRI[] (18388): reportDrawFinished
D/ViewRootImplExtImpl(18388): wrapConfigInfoIntoFlags rotation=1, smallestScreenWidthDp=424, relayoutAsync=true, newFlags=256, title=com.metafocuz.replay/com.metafocuz.replay.MainActivity
D/VRI[MainActivity](18388): relayoutWindow result, sizeChanged:false, surfaceControlChanged:false, transformHintChanged:false, mSurfaceSize:Point(2292, 1080), mLastSurfaceSize:Point(2292, 1080), mWidth:2292, mHeight:1080, requestedWidth:2292, requestedHeight:1080, transformHint:4, lastTransformHint:4, installOrientation:0, displayRotation:1, isSurfaceValid:true, attr.flag:-2122251904, useBlast:true, tmpFrames:ClientWindowFrames{frame=[108,0][2400,1080] display=[108,0][2400,1080] parentFrame=[108,0][2400,1080] parentClippedByDisplayCutout}
W/VRI[MainActivity](18388): updateBlastSurfaceIfNeeded, surfaceSize:Point(2292, 1080), lastSurfaceSize:Point(2292, 1080), format:-3, blastBufferQueue:android.graphics.BLASTBufferQueue@867b86f
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
I/SurfaceControl(18388): setExtendedRangeBrightness sc=Surface(name=com.metafocuz.replay/com.metafocuz.replay.MainActivity)/@0x96a0cb5,currentBufferRatio=1.0,desiredRatio=1.0
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(18388): [ImageReader-2180x1080f22m4-18388-0](id:47d400000002,api:1,p:1595,c:18388) dequeueBuffer: BufferQueue has been abandoned
And in posture
V/ListServiceUtils(20031): checkInListByUid end module:change-futex-timeout uid:10376 time 100534934254us
D/ListServiceUtils(20031): checkInListByUid module:change-futex-timeout uid:10376 cost 96us return 0
D/AudioTrack(20031): start(244): prior state:STATE_STOPPED output 13 stream 3 session 2673
D/MediaRouter(20031): onRestoreRoute() : route=RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
V/MediaRouter(20031): Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
V/ListServiceUtils(20031): getListValueByName module:control package:audioBoostEnable cost 88us return 1
V/ListServiceUtils(20031): checkInListByUid start module:audio-boost-blacklist uid:10376 time 100534939252us
V/ListServiceUtils(20031): checkInListByUid end module:audio-boost-blacklist uid:10376 time 100534939386us
D/ListServiceUtils(20031): checkInListByUid module:audio-boost-blacklist uid:10376 cost 133us return 0
D/nativeloader(20031): Load /data/app/~~B7VqRai53NXXEG2xUj5sbw==/com.metafocuz.replay-RONpoWXQklY4WPzrXJhAzA==/lib/arm64/lib_burst_generated.so using ns clns-7 from class loader (caller=/data/app/~~B7VqRai53NXXEG2xUj5sbw==/com.metafocuz.replay-RONpoWXQklY4WPzrXJhAzA==/base.apk): ok
I/SwappyVk(20031): Returning refresh duration of 16666666 nsec (approx 60.000002 Hz)
E/BufferQueueProducer(20031): [ImageReader-1080x2288f22m4-20031-0](id:4e3f00000002,api:1,p:1595,c:20031) dequeueBuffer: BufferQueue has been abandoned
D/BLASTBufferQueue(20031): [SurfaceView[com.metafocuz.replay]#3](f:0,a:1) acquireNextBufferLocked size=2292x1080 mFrameNumber=1 applyTransaction=true mTimestamp=100535121605189 mPendingTransactions.size=0 graphicBufferId=86032489906228 transform=0
E/BufferQueueProducer(20031): [ImageReader-1080x2288f22m4-20031-0](id:4e3f00000002,api:1,p:1595,c:20031) dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(20031): [ImageReader-1080x2288f22m4-20031-0](id:4e3f00000002,api:1,p:1595,c:20031) dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(20031): [ImageReader-1080x2288f22m4-20031-0](id:4e3f00000002,api:1,p:1595,c:20031) dequeueBuffer: BufferQueue has been abandoned
W/Unity (20031): The referenced script on this Behaviour (Game Object 'Directional Light') is missing!
W/Unity (20031): The referenced script on this Behaviour (Game Object 'Settings') is missing!
E/BufferQueueProducer(20031): [ImageReader-1080x2288f22m4-20031-0](id:4e3f00000002,api:1,p:1595,c:20031) dequeueBuffer: BufferQueue has been abandoned
E/BufferQueueProducer(20031): [ImageReader-1080x2288f22m4-20031-0](id:4e3f00000002,api:1,p:1595,c:20031)
dequeueBuffer: BufferQueue has been abandoned
🙏 Request
Please help investigate:
Why Unity shows a white screen on first load only.
Why Unity never renders in one specific activity #(posture).
[timbotimbo: edited log formatting for readability]