Reputation: 741
I am working on a flutter project when I am trying to generate my APK from Build->Flutter->Build APK option it will not showing proper UI with colour and content.
You can refer to the below-mentioned image.
But When I am trying to generate build from the Android folder open on New Window and generate the build from there will loads UI with colour and content properly.
When I am trying to generate build from Flutter Window it was showing following command on Message TAB:
"C:\Flutter SDK\flutter\bin\flutter.bat" --no-color build apk
Can you please let me know what I am doing wrong over here, or what is something I am skipping here?
You can consider my flutter sdk version by the following image.
Even after resolving this Android toolchain issue, I have tried creating build using flutter build apk
and flutter --color build apk
but still after generating the build getting the same UI issues.
Upvotes: 2
Views: 873
Reputation: 741
Okay, so after lot of research and test&try's I am getting solution for this. Please refer to below link:
github issue for grey screen on release build
Here, they have given proper explanation about the issue: On debug build we have the red screen for rendering layouts same way on the release build that returns with grey screen.
For my case I have found GestureDetector
to Flexible
widget which is wrong.
Hierarchy for my widgets is:
GestureDetector
⮑Flexible
⮑Container
⮑Icon
This is wrong, we have to take gestureDetector
onTap
event for the Container
rather than Flexible
.
Upvotes: 1