# Kotlin and Android Development featuring Jetpack:

**URL:** <https://forum.devtalk.com/t/kotlin-and-android-development-featuring-jetpack/9849>\
**Category:** PragProg Customers\
**Tags:** book-kotlin-and-android-development-featuring-jetpack, suggestion\
**Created:** [24 May 2021 13:43 UTC](https://forum.devtalk.com/t/kotlin-and-android-development-featuring-jetpack/9849 "2021-05-24T13:43:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vickyvalverdeg](https://forum.devtalk.com/user_avatar/forum.devtalk.com/vickyvalverdeg/32/2839_2.png) [@vickyvalverdeg](https://forum.devtalk.com/u/vickyvalverdeg)\
**Post date:** [24 May 2021 13:43 UTC](https://forum.devtalk.com/t/kotlin-and-android-development-featuring-jetpack/9849/1 "2021-05-24T13:43:39Z")

</div>

There is an error when following steps to use the `nav_version` variable in project’s build.gradle of Penny\_Drop.

Following the official documentation the way to use this variable is adding in the app’s build.gradle file: [https://developer.android.com/guide/navigation/navigation-getting-started](https://developer.android.com/guide/navigation/navigation-getting-started)

```auto

dependencies {
  def nav_version = "2.3.5"

  implementation "androidx.navigation:navigation-fragment:$nav_version"
  implementation "androidx.navigation:navigation-ui:$nav_version"

  .......
}

```

---

<div class="post-metadata">

**Author:** ![mfazio23](https://forum.devtalk.com/user_avatar/forum.devtalk.com/mfazio23/32/528_2.png) [@mfazio23](https://forum.devtalk.com/u/mfazio23)\
**Post date:** [25 May 2021 19:07 UTC](https://forum.devtalk.com/t/kotlin-and-android-development-featuring-jetpack/9849/2 "2021-05-25T19:07:55Z")

</div>

Hey there!  
What is the error you’re seeing with Penny Drop? I’m surprised that the variables aren’t working as they’ve been that way for the lifetime of the book.

Do make sure you’re using double quotes in the dependency lines as single quotes ignore variables. That’s thrown me off before.

Also, what you linked is absolutely valid as well. I just went with having variables in the project-level file since that was how Google defaulted things when I started the apps. If you wish to move variables into the `dependencies` block, that’s also just fine.

Let me know on what you’re seeing and we’ll get it fixed.

Thanks!

---

<div class="post-metadata">

**Author:** ![vickyvalverdeg](https://forum.devtalk.com/user_avatar/forum.devtalk.com/vickyvalverdeg/32/2839_2.png) [@vickyvalverdeg](https://forum.devtalk.com/u/vickyvalverdeg)\
**Post date:** [30 May 2021 04:19 UTC](https://forum.devtalk.com/t/kotlin-and-android-development-featuring-jetpack/9849/3 "2021-05-30T04:19:59Z")

</div>

Thanks @mfazio23 for your answer 😄, I founded the error, I was using a code from beta version of the book, so now with the latest version it works, this is the updated code in `build.gradle`:

```auto
buildscript {
    ext {
        kotlin_version = "1.4.30"
        nav_version= "2.3.3"
    }
// other code 
}

```

---

<div class="post-metadata">

**Author:** ![mfazio23](https://forum.devtalk.com/user_avatar/forum.devtalk.com/mfazio23/32/528_2.png) [@mfazio23](https://forum.devtalk.com/u/mfazio23)\
**Post date:** [30 May 2021 16:19 UTC](https://forum.devtalk.com/t/kotlin-and-android-development-featuring-jetpack/9849/4 "2021-05-30T16:19:06Z")

</div>

Good, glad it’s working!
