Kishan sharma
Kishan sharma

Reputation: 741

Creating build from Build->Flutter->Build APK can generate build without colors and data

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

enter image description here

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.

enter image description here

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

Answers (1)

Kishan sharma
Kishan sharma

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

Related Questions