# How to make the examples work

**URL:** <https://forums.kodeco.com/t/how-to-make-the-examples-work/197802>\
**Category:** Real-World Flutter by Tutorials\
**Tags:** flutter\
**Created:** [October 14, 2023, 7:41am UTC](https://forums.kodeco.com/t/how-to-make-the-examples-work/197802 "2023-10-14T07:41:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![eshfield](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/eshfield/32/105896_2.png) [@eshfield](https://forums.kodeco.com/u/eshfield)\
**Post date:** [October 15, 2023, 5:43am UTC](https://forums.kodeco.com/t/how-to-make-the-examples-work/197802/2 "2023-10-15T05:43:56Z")

</div>

Actually you _can_ run book’s projects without it’s recreating on the up-to-date version of Flutter 3.13.6.

Here is a complete list of fixes you need to make after opening a clean `starter` project in the code editor (tested on Windows 11 22H2 and VS Code 1.83.1):

1. As suggested [in this post](https://forums.kodeco.com/t/solved-chapter-1-start-doesnt-run/185808/2) add explicit `FavQsApi` and `RoutemasterDelegate` types to the main file:

```auto
lib\main.dart

line 79
late final _favQsApi = FavQsApi(
→ (change to)
late final FavQsApi _favQsApi = FavQsApi(

line 91
late final _routerDelegate = RoutemasterDelegate(
→
late final RoutemasterDelegate _routerDelegate = RoutemasterDelegate(

```

1. Update the `intl` package version for two local packages:

```auto
packages\component_library\pubspec.yaml
packages\features\profile_menu\pubspec.yaml

intl: ^0.17.0
→ 
intl: ^0.18.1

```

1. Bump `infinite_scroll_pagination` package version since it uses outdate `sliver_tools` package:

```auto
packages\features\quote_list\pubspec.yaml

infinite_scroll_pagination: ^4.0.0-dev.1
→
infinite_scroll_pagination: ^4.0.0

```

1. Update `gradle` and `google-services` versions to build the project correctly:

```auto
android\build.gradle

classpath 'com.android.tools.build:gradle:4.1.0'
→
classpath 'com.android.tools.build:gradle:7.4.1'

classpath 'com.google.gms:google-services:4.3.10'
→
classpath 'com.google.gms:google-services:4.3.14'

```

1. Raise `compileSdkVersion` to current value:

```auto
android\app\build.gradle

line 31
compileSdkVersion 31
→
compileSdkVersion 33

```

1. All dependencies in `monitoring` package need to be updated—replace whole `dependencies` section with the following (leave `dev_dependencies` as is):

```auto
packages\monitoring\pubspec.yaml

dependencies:
  …
→
dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^2.17.0
  firebase_crashlytics: ^3.3.7
  firebase_dynamic_links: ^5.3.7
  firebase_analytics: ^10.5.1
  firebase_remote_config: ^4.2.7

```

1. As [discussed here](https://forums.kodeco.com/t/error-on-searchbar/187741/4) rename (with `F2` button) `SearchBar` class with something different to avoid a name collision:

```auto
packages\component_library\lib\src\search_bar.dart

line 4
SearchBar
→
AppSearchBar

```

1. Finally you can get packages:  
`make get`

On Windows you may need to use Git Bash terminal instead of default PowerShell to run this command successfully—[here are the details](https://forums.kodeco.com/t/make-command-fails/179809/11).

That’s all! Now you can build and run projects without problems (after fixing all the suggested in the book’s chapter issues of course if you have opened a `starter` project).

---

_[View the full topic](https://forums.kodeco.com/t/how-to-make-the-examples-work/197802)._
