简体   繁体   中英

unresolved reference: fillMaxSize() and unresolved reference: size() error in android studio with Kotlin

I started very basic android development and from the very first day it seems that android studio and kotlin are just like a bundle of problems. Like after first installation of androidstudio I build the basic samples on Kotlin and it worked fine. After few hours I got a notification on androidstudio about some update so I did it and then every thing stopped working I looked for solution on Inte.net and tried for 2-3 hours but didn't get it back working. Then I uninstalled everything related to androidstudio on my PC and re-installed it and then it started to work again.

After few days I started to implement a tutorial and I used the same code and configuration described in tutorial but on the very first step where they just created a basic sample application without any thing and it started to show errors like Unresolved reference: fillMaxSize and Unresolved reference: size and I couldn't find any solid solution on Inte.net and surprisingly found out that inte.net is full of these kind of issues on androidstudio. In the project I am using the function fillMaxSize() in another file where it works 100% fine but in the same project but in different file it gives error. Can anybody give a solution to this?

Apart from this I just want to ask that is android development in general is like this? That every time you go 1 line further and you see new errors and then you have to spend hours on inte.net and look for solutions and you then found tons of queries about these errors on inte.net and nothing is clear and particularly working for your case but it is kind of similar error_

Adding new imports, changing plugin versions, adding plugins, changing dependencies and versions.

After few hours I got a notification on androidstudio about some update so I did it and then every thing stopped working

Updates of course are good as they try to fix or enhance something. However, some updates will add, remove or change some previous working functions to achieve the fixing or enhancing purpose. And that's why some programs require certain version of Software instead of always the latest one to run.

In the project I am using the function fillMaxSize() in another file where it works 100% fine but in the same project but in different file it gives error

In this case, you will have to check whether you have really added the corresponding import to that particular file. If there is really configuration problem, it should not have worked in one file but not the other. import is something that you have to do in every file using that function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM