ios – Unable to load asset: Error thrown Occasion of ‘ErrorDescription’

[ad_1]

i’m receiving this error solely from iphone ios 14 units

Deadly Exception: FlutterError
Unable to load asset: belongings/photographs/settings_unselected_icon.png.. Error thrown Occasion of ‘ErrorDescription’.

screenshot from crashlytics

My app is working nice on any ios model besides ios 14

right here is my code

class FitnessAppHomeScreen extends StatefulWidget {
  const FitnessAppHomeScreen({Key? key}) : tremendous(key: key);

  @override
  _FitnessAppHomeScreenState createState() => _FitnessAppHomeScreenState();
}

class _FitnessAppHomeScreenState extends State<FitnessAppHomeScreen> {
  Listing<TabIconData> tabIconsList = TabIconData.tabIconsList;
  var _selectedTab = _SelectedTab.residence;

  void _handleIndexChanged(int i) {
    setState(() {
      _selectedTab = _SelectedTab.values[i];
    });
  }

  Widget tabBody = Container(
    colour: Colours.white,
  );

  @override
  void initState() {
    PrivacyScreen.occasion.allow(
      iosOptions: const PrivacyIosOptions(
        enablePrivacy: true,
        privacyImageName: "LaunchImage",
        autoLockAfterSeconds: 1,
        lockTrigger: IosLockTrigger.didEnterBackground,
      ),
      androidOptions: const PrivacyAndroidOptions(
        enableSecure: true,
        autoLockAfterSeconds: 1,
      ),
      backgroundColor: Colours.gray.withOpacity(0.11),
      blurEffect: PrivacyBlurEffect.darkish,
    );
    for (closing tab in tabIconsList) {
      tab.isSelected = false;
    }
    tabIconsList[0].isSelected = true;

    tabBody = const CustomizedView();
    dataStore.setSessions('currentSession', 0);
    incrementUserSession();
    if (Platform.isIOS) {
      requestAttributionDetails();
    }

    Future.delayed(const Period(milliseconds: 200), () {
      if (dataStore.getSettings('pin').isEmpty) {
        PrivacyScreen.occasion.pauseLock();
      } else {
        PrivacyScreen.occasion.resumeLock();
        PrivacyScreen.occasion.unlock();
        PrivacyScreen.occasion.lock();
      }
    });
    tremendous.initState();
  }

  Future<void> requestAttributionDetails() async {
    String? token;

    strive {
      token = await FlutterAsaAttribution.occasion.attributionToken();
      if (kDebugMode) {
        print(token);
      }
    } catch (e) {
      if (kDebugMode) {
        print(e);
      }
    }
  }

  @override
  Widget construct(BuildContext context) {
//

    return Container(
      colour: Colours.white,
      baby: Scaffold(
        backgroundColor: Colours.clear,
        physique: GestureDetector(
          onTap: () {
            closing currentFocus = FocusScope.of(context);

            if (!currentFocus.hasPrimaryFocus) {
              currentFocus.unfocus();
            }
          },
          baby: Stack(
            kids: <Widget>[
              tabBody,
              Column(
                children: [
                  const Expanded(
                    child: SizedBox(),
                  ),
                  DotNavigationBar(
                    paddingR: const EdgeInsets.only(bottom: 5, top: 5),
                    marginR: const EdgeInsets.symmetric(
                        horizontal: 35, vertical: 15),
                    // margin: const EdgeInsets.only(left: 10, right: 10),
                    currentIndex: _SelectedTab.values.indexOf(_selectedTab),
                    dotIndicatorColor: Colors.white,
                    selectedItemColor: const Color(0xFF2EBDD8),
                    unselectedItemColor: Colors.grey[300],
                    enableFloatingNavBar: true,
                    enablePaddingAnimation: false,
                    boxShadow: const [
                      BoxShadow(
                          offset: Offset(1, 1),
                          color: Colors.black12,
                          blurRadius: 5.0,
                          spreadRadius: 1.0)
                    ],

                    onTap: (index) {
                      _handleIndexChanged(index);
                      if (index == 0) {
                        if (!mounted) {
                          return;
                        }
                        setState(() {
                          tabBody = const CustomizedView();
                        });
                      } else if (index == 1) {
                        if (!mounted) {
                          return;
                        }
                        setState(() {
                          tabBody = const GenerateCodeScreen();
                        });
                      } else if (index == 2) {
                        if (!mounted) {
                          return;
                        }
                        setState(() {
                          tabBody = const HistoryPage();
                        });
                      } else if (index == 3) {
                        if (!mounted) {
                          return;
                        }
                        setState(() {
                          tabBody = const SettingsPage();
                        });
                      }
                    },
                    objects: [
                     
                      DotNavigationBarItem(
                        icon: Image.asset(
                            'assets/images/scanner_unselected_icon.png',
                            scale: 1.9,
                            color: _selectedTab.index == 0
                                ? const Color(0xFF2EBDD8)
                                : null),
                        selectedColor: const Color(0xFF2EBDD8),
                      ),

                      
                      DotNavigationBarItem(
                        icon: Image.asset(
                            'assets/images/generate_unselected_icon.png',
                            scale: 1.9,
                            color: _selectedTab.index == 1
                                ? const Color(0xFF2EBDD8)
                                : null),
                        selectedColor: const Color(0xFF2EBDD8),
                      ),

                     
                      DotNavigationBarItem(
                        icon: Image.asset(
                            'assets/images/history_unselected.png',
                            scale: 1.9,
                            color: _selectedTab.index == 2
                                ? const Color(0xFF2EBDD8)
                                : null),
                        selectedColor: const Color(0xFF2EBDD8),
                      ),

                      
                      DotNavigationBarItem(
                        icon: Image.asset(
                            'assets/images/settings_unselected_icon.png',
                            scale: 1.9,
                            color: _selectedTab.index == 3
                                ? const Color(0xFF2EBDD8)
                                : null),
                        selectedColor: const Color(0xFF2EBDD8),
                      ),
                    ],
                  )
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }

right here is my pubspecs.yaml

flutter:

  # The next line ensures that the Materials Icons font is
  # included along with your software, in an effort to use the photographs in
  # the fabric Icons class.
  uses-material-design: true


  belongings:
    - belongings/photographs/calender_icon.png
    - belongings/photographs/name.png
    - belongings/photographs/barcode.png
    - belongings/photographs/clipboard_icon.png
    - belongings/photographs/clipboard_icon.png
    - belongings/photographs/contacts_icon.png
    - belongings/photographs/e mail.png
    - belongings/photographs/email_icon.png
    - belongings/photographs/fb.png
    - belongings/photographs/fb-white.png
    - belongings/photographs/gallery_icon.png
    - belongings/photographs/photograph.png
    - belongings/photographs/generate_selected_icon.png
    - belongings/photographs/generate_unselected_icon.png
    - belongings/photographs/history_selected.png
    - belongings/photographs/history_unselected.png
    - belongings/photographs/rateus.png
    - belongings/photographs/rateus_circle.png
    - belongings/photographs/rateus_star.png
    - belongings/photographs/ig.png
    - belongings/photographs/ig-white.png
    - belongings/photographs/sc.png
    - belongings/photographs/sc1.png
    - belongings/photographs/sc1-white.png
    - belongings/photographs/messages_icon.png
    - belongings/photographs/phone_icon.png
    - belongings/photographs/scanner_selected_icon.png
    - belongings/photographs/scanner_unselected_icon.png
    - belongings/photographs/speech-bubble.png
    - belongings/photographs/spotify_icon.png
    - belongings/photographs/spotify_icon-white.png
    - belongings/photographs/settings_selected_icon.png
    - belongings/photographs/settings_unselected_icon.png
    - belongings/photographs/telegram.png
    - belongings/photographs/text_icon.png
    - belongings/photographs/tg.png
    - belongings/photographs/tg-white.png
    - belongings/photographs/tool_img.png
    - belongings/photographs/clear.png
    - belongings/photographs/twitter_icon.png
    - belongings/photographs/twitter_icon-white.png
    - belongings/photographs/url_icon.png
    - belongings/photographs/viber.png
    - belongings/photographs/viber-white.png
    - belongings/photographs/video_on.png
    - belongings/photographs/video_off.png
    - belongings/photographs/whatsapp.png
    - belongings/photographs/whatsapp-white.png
    - belongings/photographs/wifi_icon.png
    - belongings/photographs/woman.png
    - belongings/photographs/group_dots.png
    - belongings/photographs/intro_1.png
    - belongings/photographs/intro_2.png
    - belongings/photographs/red_dot.png
    - belongings/photographs/white_dot.png
    - belongings/photographs/next_icon.png
    - belongings/photographs/scan_icon.png
    - belongings/photographs/idfa_allow.png
    - belongings/photographs/coronary heart.png
    - belongings/photographs/analytics.png
    - belongings/photographs/success.png
    - belongings/sound/scan_beep.mp3
    - belongings/svg/google.svg
    - belongings/svg/ebay.svg
    - belongings/svg/amazon.svg
    - belongings/svg/clear.svg
    - belongings/svg/google_shopping.svg
    - belongings/svg/google-shopping-logo.png
    - belongings/svg/openfoodfacts.svg


  fonts:
    - household: SFPRO
      fonts:
        - asset: belongings/fonts/sfpro/SFProDisplay-Daring.ttf
          weight: 700
        - asset: belongings/fonts/sfpro/SFProDisplay-Medium.ttf
          weight: 400
        - asset: belongings/fonts/sfpro/SFProDisplay-Semibold.ttf
          weight: 500

i’ve tried some individuals suggestion to wash up my flutter undertaking like these steps, however with no success in any respect

Fast Clear Cache

Open android studio Instruments->Flutter->Clear.
Go to File -> Invalidate Caches / Restart.
Or open terminal run “flutter clear”
Take away pubspec.lock.

[ad_2]

Leave a Reply