asset images not showing in release version of app in flutter?

2.4k views Asked by At

I have made a list of images and using ListView.builder to display the images and its working perfectly fine while debugging and even in debug apk of the app but when i use release apk its not showing the images.

List<Activity> act = [
    Activity('assets/sports.png', 'Sports', false),
    Activity('assets/sleeping.png', 'Sleep', false),
    Activity('assets/shop.png', 'Shop', false),
    Activity('assets/relax.png', 'Relax', false),]

I am using ListView.builder to show images like this:

ListView.builder(
              scrollDirection: Axis.horizontal,
              itemCount: act.length,
              itemBuilder: (context, index) {
                return Row(children: <Widget>[
                  SizedBox(
                    width: 15,
                  ),
                  GestureDetector(
                      child: ActivityIcon(act[index].image)));
2

There are 2 answers

0
Sahil R On

Make sure that you've "use-material-design: true" line above assets

enter image description here

0
Omatt On

There doesn't seem to be an issue from the code you've provided. It'll greatly help if you're able to provide any errors received from the app when the issue occurred. Another way that you can try is by switching to different Flutter channels and see if the app performs better.