In this quick video, I just want to show
you how to go about updating a Kotlin
Android project if the Kotlin runtime
has been updated. So with the TaskTimer
project we're working on, I got a note
that the Kotlin runtime was out of date,
and this is what came up when I opened the project -
Outdated Kotlin Runtime - and it's talking
about the fact that 1.2.41 is now
outdated because of the release of 1.2.50.
Now if I go to click on Update Runtime,
you get this message here coming up
saying "Automatic library version
update for Maven and Gradle projects
is currently unsupported", and basically
telling you to update it manually. So
let's just quickly go through that
process of updating it manually, so that if
you come across this you'll know what to
do. So what we're going to do first is open
our Gradle scripts and we'll need to
open both of them. So we're going to start with
the first one which is the Project: Task
Timer builder.gradle. Now there's a few
things here - firstly, we can come up here,
and that's the 1.2.41
that it's referring to there. So
we're going to change that 1.2
point 41 to 1.2 point
50. So you can ignore the rest
of the information after those
numbers. The one we want to change here
is 50, so it's 1.2.50.
That's the first thing, and there shouldn't be
anything else say that we need to change
in that file. But we'll also take the
opportunity to have a look in the other
file - the Module: app build.gradle. And
if we scroll down have a bit of a look
here, you'll see there's a couple of things.
Firstly, there's this thing here wiped
out. It's basically saying that the std
lib for Kotlin jre7 is deprecated and
should be replaced, and it's basically
saying that you now need to use the jdk,
the Kotlin-stdlib-jdk7, rather than
the jre7. So we're going to take their
advice and just replace the words here -
jre. We're going to change that to jdk. Then
lastly, I'm taking the opportunity
anytime you see a particular
line here that's got a yellow background.
That's telling us there's a newer
version available. So if we hover
over it you can see that message: 1 point
1 point 2 is available. So I'm going to change
that to one point two.
So now that I've done all those things,
what I'm going to do is come up here and
click on sync, and that should update to
the latest version of everything - which
it's done - and I can close these windows
now. Now we have still got an error here,
and if we go back to our AppProvider we've
got an error here, because in the next
video we're going to start talking about
writing that particular function. Another
good thing to do then is just to close
it then open it again, just to make sure,
because often by doing that you'll get
another pop-up if something didn't work.
But in this case we've now successfully
updated, and if we go in there and have a
look now, there's nothing indicating
there's a problem there. But here also -
I've moved to another line now - there's
also nothing there, there's no problems.
There's this, this line here, line 27, that
we had a strike over in the text, has now
disappeared because we're using the
right version of both. Alright so I'm
going to close these two Gradle
scripts down now. And so I'll end the video
here and then in the next one, we'll get
back into working on the Content
Provider, specifically the content
underscore uri. So I'll see you
in the next video.