1 00:00:03,830 --> 00:00:06,779 In this quick video, I just want to show 2 00:00:06,779 --> 00:00:09,300 you how to go about updating a Kotlin 3 00:00:09,300 --> 00:00:11,880 Android project if the Kotlin runtime 4 00:00:11,880 --> 00:00:14,580 has been updated. So with the TaskTimer 5 00:00:14,580 --> 00:00:16,560 project we're working on, I got a note 6 00:00:16,560 --> 00:00:19,230 that the Kotlin runtime was out of date, 7 00:00:19,230 --> 00:00:21,560 and this is what came up when I opened the project - 8 00:00:21,560 --> 00:00:24,390 Outdated Kotlin Runtime - and it's talking 9 00:00:24,390 --> 00:00:27,930 about the fact that 1.2.41 is now 10 00:00:27,930 --> 00:00:30,480 outdated because of the release of 1.2.50. 11 00:00:30,480 --> 00:00:32,520 Now if I go to click on Update Runtime, 12 00:00:32,520 --> 00:00:34,469 you get this message here coming up 13 00:00:34,469 --> 00:00:36,059 saying "Automatic library version 14 00:00:36,059 --> 00:00:38,010 update for Maven and Gradle projects 15 00:00:38,010 --> 00:00:40,110 is currently unsupported", and basically 16 00:00:40,110 --> 00:00:41,910 telling you to update it manually. So 17 00:00:41,910 --> 00:00:42,989 let's just quickly go through that 18 00:00:42,989 --> 00:00:45,780 process of updating it manually, so that if 19 00:00:45,780 --> 00:00:46,950 you come across this you'll know what to 20 00:00:46,950 --> 00:00:49,320 do. So what we're going to do first is open 21 00:00:49,320 --> 00:00:50,730 our Gradle scripts and we'll need to 22 00:00:50,730 --> 00:00:52,649 open both of them. So we're going to start with 23 00:00:52,649 --> 00:00:55,289 the first one which is the Project: Task 24 00:00:55,289 --> 00:00:57,629 Timer builder.gradle. Now there's a few 25 00:00:57,629 --> 00:00:59,670 things here - firstly, we can come up here, 26 00:00:59,670 --> 00:01:02,010 and that's the 1.2.41 27 00:01:02,010 --> 00:01:04,500 that it's referring to there. So 28 00:01:04,500 --> 00:01:05,939 we're going to change that 1.2 29 00:01:05,939 --> 00:01:08,430 point 41 to 1.2 point 30 00:01:08,430 --> 00:01:09,840 50. So you can ignore the rest 31 00:01:09,840 --> 00:01:12,810 of the information after those 32 00:01:12,810 --> 00:01:14,520 numbers. The one we want to change here 33 00:01:14,520 --> 00:01:16,759 is 50, so it's 1.2.50. 34 00:01:16,759 --> 00:01:19,619 That's the first thing, and there shouldn't be 35 00:01:19,619 --> 00:01:20,640 anything else say that we need to change 36 00:01:20,640 --> 00:01:22,799 in that file. But we'll also take the 37 00:01:22,799 --> 00:01:24,030 opportunity to have a look in the other 38 00:01:24,030 --> 00:01:27,420 file - the Module: app build.gradle. And 39 00:01:27,420 --> 00:01:28,590 if we scroll down have a bit of a look 40 00:01:28,590 --> 00:01:30,210 here, you'll see there's a couple of things. 41 00:01:30,210 --> 00:01:32,400 Firstly, there's this thing here wiped 42 00:01:32,400 --> 00:01:34,950 out. It's basically saying that the std 43 00:01:34,950 --> 00:01:38,100 lib for Kotlin jre7 is deprecated and 44 00:01:38,100 --> 00:01:40,079 should be replaced, and it's basically 45 00:01:40,079 --> 00:01:42,409 saying that you now need to use the jdk, 46 00:01:42,409 --> 00:01:47,610 the Kotlin-stdlib-jdk7, rather than 47 00:01:47,610 --> 00:01:49,500 the jre7. So we're going to take their 48 00:01:49,500 --> 00:01:51,299 advice and just replace the words here - 49 00:01:51,299 --> 00:01:55,200 jre. We're going to change that to jdk. Then 50 00:01:55,200 --> 00:01:56,090 lastly, I'm taking the opportunity 51 00:01:56,090 --> 00:01:58,200 anytime you see a particular 52 00:01:58,200 --> 00:02:01,079 line here that's got a yellow background. 53 00:02:01,079 --> 00:02:02,790 That's telling us there's a newer 54 00:02:02,790 --> 00:02:04,229 version available. So if we hover 55 00:02:04,229 --> 00:02:06,509 over it you can see that message: 1 point 56 00:02:06,509 --> 00:02:08,940 1 point 2 is available. So I'm going to change 57 00:02:08,940 --> 00:02:11,210 that to one point two. 58 00:02:11,210 --> 00:02:12,860 So now that I've done all those things, 59 00:02:12,860 --> 00:02:14,450 what I'm going to do is come up here and 60 00:02:14,450 --> 00:02:18,200 click on sync, and that should update to 61 00:02:18,200 --> 00:02:20,840 the latest version of everything - which 62 00:02:20,840 --> 00:02:22,040 it's done - and I can close these windows 63 00:02:22,040 --> 00:02:26,120 now. Now we have still got an error here, 64 00:02:26,120 --> 00:02:28,760 and if we go back to our AppProvider we've 65 00:02:28,760 --> 00:02:29,840 got an error here, because in the next 66 00:02:29,840 --> 00:02:31,070 video we're going to start talking about 67 00:02:31,070 --> 00:02:33,620 writing that particular function. Another 68 00:02:33,620 --> 00:02:34,940 good thing to do then is just to close 69 00:02:34,940 --> 00:02:37,840 it then open it again, just to make sure, 70 00:02:37,840 --> 00:02:40,670 because often by doing that you'll get 71 00:02:40,670 --> 00:02:42,050 another pop-up if something didn't work. 72 00:02:42,050 --> 00:02:43,100 But in this case we've now successfully 73 00:02:43,100 --> 00:02:45,380 updated, and if we go in there and have a 74 00:02:45,380 --> 00:02:49,430 look now, there's nothing indicating 75 00:02:49,430 --> 00:02:51,380 there's a problem there. But here also - 76 00:02:51,380 --> 00:02:53,780 I've moved to another line now - there's 77 00:02:53,780 --> 00:02:55,430 also nothing there, there's no problems. 78 00:02:55,430 --> 00:02:58,250 There's this, this line here, line 27, that 79 00:02:58,250 --> 00:03:01,130 we had a strike over in the text, has now 80 00:03:01,130 --> 00:03:02,300 disappeared because we're using the 81 00:03:02,300 --> 00:03:04,370 right version of both. Alright so I'm 82 00:03:04,370 --> 00:03:06,680 going to close these two Gradle 83 00:03:06,680 --> 00:03:08,720 scripts down now. And so I'll end the video 84 00:03:08,720 --> 00:03:10,790 here and then in the next one, we'll get 85 00:03:10,790 --> 00:03:13,160 back into working on the Content 86 00:03:13,160 --> 00:03:14,570 Provider, specifically the content 87 00:03:14,570 --> 00:03:16,580 underscore uri. So I'll see you 88 00:03:16,580 --> 00:03:19,600 in the next video.