# Pleas help me i have problem in my project

**URL:** <https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151>\
**Category:** Android\
**Created:** [March 22, 2018, 6:37pm UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151 "2018-03-22T18:37:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbfdbhj](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dbfdbhj](https://discuss.kotlinlang.org/u/dbfdbhj)\
**Post date:** [March 22, 2018, 6:37pm UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/1 "2018-03-22T18:37:33Z")

</div>

![1254](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/9/9051e389b69f7458e78ae00ab32454f2f797d97b.png)

hello friends

at my project i get this problem

what is solution

---

<div class="post-metadata">

**Author:** ![dalewking](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/dalewking/32/1496_2.png) [@dalewking](https://discuss.kotlinlang.org/u/dalewking)\
**Post date:** [March 22, 2018, 8:46pm UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/2 "2018-03-22T20:46:12Z")

</div>

Kotlin is usually good at allowing you to call properties defined in Java using the getName/setName convention in Kotlin using the property syntax of “.name”.

However TextView (which is the superclass of EditText) defines overloads of setText so the type has these methods:

```
getText()
setText(int resid)
setText(CharSequence text)
setText(CharSequence text, TextView.BufferType type)
setText(int resid, TextView.BufferType type)
setText(char[] text, int start, int len)

```

With all these variations on setText Kotlin doesn’t think that text is a standard Java property and doesn’t allow you to access it as “.text” and you have to fall back to calling getText and setText methods.

Some Kotlin libraries may help work around this by defining alternately named extension properties, but in this case you will probably just need to use getText and setText methods.

---

<div class="post-metadata">

**Author:** ![dbfdbhj](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dbfdbhj](https://discuss.kotlinlang.org/u/dbfdbhj)\
**Post date:** [March 23, 2018, 5:50am UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/3 "2018-03-23T05:50:33Z")

</div>

how can i use this  
i try instead text do gettext and set text but no solution good

---

<div class="post-metadata">

**Author:** ![dalewking](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/dalewking/32/1496_2.png) [@dalewking](https://discuss.kotlinlang.org/u/dalewking)\
**Post date:** [March 23, 2018, 6:05am UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/4 "2018-03-23T06:05:45Z")

</div>

So the first error line replace “.text” with “.getText()”. The other line you replace “.text = value” with “.setText(value)”

---

<div class="post-metadata">

**Author:** ![pdvrieze](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/pdvrieze/32/1882_2.png) [@pdvrieze](https://discuss.kotlinlang.org/u/pdvrieze)\
**Post date:** [March 23, 2018, 9:42am UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/5 "2018-03-23T09:42:07Z")

</div>

The problem is an import problem. Look carefully and you will see that etUserYearOfBirth is a resource Id. Because you are importing all resource Id’s into the namespace this will be resolved as a resourceId (integer).

What you probably intended to do was to use the [Kotlin android extensions](https://kotlinlang.org/docs/tutorials/android-plugin.html) instead. You will have to make sure that they are enabled in your gradle file and remove the import of the id constants (this import is probably problematic, you should normally use R.id.\* explicitly to avoid exactly the problem you’re having now).

---

<div class="post-metadata">

**Author:** ![dbfdbhj](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@dbfdbhj](https://discuss.kotlinlang.org/u/dbfdbhj)\
**Post date:** [March 23, 2018, 10:09am UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/6 "2018-03-23T10:09:04Z")

</div>

sorry friend iam new in this field can u explain for me step by step …

---

<div class="post-metadata">

**Author:** ![pdvrieze](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/pdvrieze/32/1882_2.png) [@pdvrieze](https://discuss.kotlinlang.org/u/pdvrieze)\
**Post date:** [March 23, 2018, 10:13am UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/7 "2018-03-23T10:13:19Z")

</div>

The linked article provides instructions in quite some detail. You should attempt to follow them. In short however do the following:

- remove the offending import.
- Add the extensions plugin in your build.gradle file
- import the synthetic extension names into your activity file (the ide should actually make this easy for you)

---

<div class="post-metadata">

**Author:** ![er.abhishek.luthra](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/er.abhishek.luthra/32/4977_2.png) [@er.abhishek.luthra](https://discuss.kotlinlang.org/u/er.abhishek.luthra)\
**Post date:** [April 1, 2018, 9:37pm UTC](https://discuss.kotlinlang.org/t/pleas-help-me-i-have-problem-in-my-project/7151/8 "2018-04-01T21:37:33Z")

</div>

Follow this article [How Does Kotlin Generate Property from Java Getters and Setters (Undocumented by Jetbrains)](https://medium.com/@er.abhishek.luthra/how-does-kotlin-generated-property-from-java-getters-and-setters-undocumented-by-jetbrains-7e1ad88052b1)
