nicoatridge

nicoatridge

Kotlin and Android Development: Could not get unknown property ‘kotlin_version’…

Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in python, js, and - in a basic, command line form - in kotlin and want to port it to Android (web version at https://basilisk.net). Anyway, got to page 8 and was editting the build.graddle file and found that the line

implementation “org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version”

threw up an error “Could not get unknown property ‘kotlin_version’…”

the line jvmTarget = ‘1.8’ was already in the build.graddle file but the dependencies identified were not. Editting out the problematic kotlin_version line and the program runs fine, but I don’t want to waste my time if this is something that causes more problems downstream.

I am on Arctic Fox 2020.3.1 Patch 1.

0 7905 6

Marked As Solved

mfazio23

mfazio23

Author of Kotlin and Android Development featuring Jetpack

Hey Nic! This is a known issue when using newer versions of Android Studio. They used to add the $kotlin_version variable for you when creating a new project, but no longer.

If you open the project’s build.gradle file (not the app’s file of the same name), you can add an ext block to the buildscript block to include that variable:

buildscript {
    ext {
        kotlin_version = '1.4.10'
        gradle_version = '4.1.0'
    }
   // The rest of the buildscript lives down here.
}

Let me know if this helps!

Popular Prag Prog topics Top

johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
5 3517 1
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
22 1618 20
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
1 1213 1
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
3 1296 17
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
2 1163 8
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
5 1387 5
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
0 3880 1
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
2 2080 9
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
0 1459 5
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
8 1082 4
New

Other popular topics Top

AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
14 7486 9
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
24 3380 25
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
9 4158 7
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
34 3628 22
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
66 19971 25
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1118 25024 737
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
32 2728 10
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
106 10202 29
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
5 7046 4
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
16 3805 12
New