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 7936 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

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
4 1547 7
New
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
10 1443 5
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
15 1542 13
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
0 1290 3
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
0 1830 1
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
2 1436 3
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
0 7935 6
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 3915 1
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
7 1151 10
New

Other popular topics Top

Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
36 5150 10
New
New
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 3384 24
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
31 3355 15
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
155 4122 65
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
19 2841 10
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
49 4145 14
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
15 4341 1
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
0 2498 1
New

Latest in PragProg

View all threads ❯