简体   繁体   English

未解决的参考:fillMaxSize() 和未解决的参考:android 工作室中的 size() 错误与 Kotlin

[英]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.我开始了非常基本的 android 开发,从第一天开始,android studio 和 kotlin 似乎就像一堆问题。 Like after first installation of androidstudio I build the basic samples on Kotlin and it worked fine.就像第一次安装 androidstudio 后一样,我在 Kotlin 上构建了基本示例,它运行良好。 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.几个小时后,我在 androidstudio 上收到了关于一些更新的通知,所以我做了它,然后一切都停止了工作我在 Inte.net 上寻找解决方案并尝试了 2-3 小时但没有让它恢复工作。 Then I uninstalled everything related to androidstudio on my PC and re-installed it and then it started to work again.然后我在我的电脑上卸载了所有与androidstudio相关的东西并重新安装它然后它又开始工作了。

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.几天后,我开始实施一个教程,我使用了教程中描述的相同代码和配置,但在第一步,他们只是创建了一个没有任何东西的基本示例应用程序,它开始显示错误,如Unresolved reference: fillMaxSize and Unresolved参考:size我在 Inte.net 上找不到任何可靠的解决方案,并且惊讶地发现 inte.net 在 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.在项目中,我在另一个文件中使用 function fillMaxSize(),它可以 100% 正常工作,但在同一个项目中,但在不同的文件中它会出错。 Can anybody give a solution to this?有人可以解决这个问题吗?

Apart from this I just want to ask that is android development in general is like this?除此之外我只想问就是android开发一般是这样的? 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_每次你 go 1 行时,你都会看到新的错误,然后你必须在 inte.net 上花费数小时并寻找解决方案,然后你会在 inte.net 上发现大量关于这些错误的查询,但没有什么是明确的,特别适用于你的情况,但它是一种类似的错误_

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几个小时后,我在 androidstudio 上收到了一些更新的通知,所以我做了,然后一切都停止了

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在项目中,我在另一个文件中使用 function fillMaxSize(),它可以 100% 正常工作,但在同一个项目中,但在不同的文件中,它会出错

In this case, you will have to check whether you have really added the corresponding import to that particular file.在这种情况下,您将必须检查是否真的将相应的import添加到该特定文件。 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. import是你必须在使用 function 的每个文件中做的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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