question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Always need to do Clean Project

See original GitHub issue

Здравствуйте. Решил попробовать Moxy взял ваш код с презентации и написал на kotlin. Но вот беда появилась ошибка

kotlin.UninitializedPropertyAccessException: lateinit property counterPresenter has not been initialized

делаю Clean Project и нормально, потом делаю изменения в коде и опять ошибка пока не сделаю Clean Project.

@InjectViewState
class CounterPresenter : MvpPresenter<CounterView>() {

    var count: Int = 0

    init {
        viewState.showView(count)
    }

    fun onPlusClick() {
        count++
        viewState.showView(count)
    }
}

interface CounterView : MvpView {
    fun showView(count: Int)
}
class CounterFragment : MvpAppCompatFragment(), CounterView {

    @InjectPresenter
    lateinit var counterPresenter: CounterPresenter

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater?.inflate(R.layout.fragment, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        parentView.setBackgroundColor(arguments.getInt("color", 0))

        button.setOnClickListener {
            countPlus()
        }
    }

    fun countPlus() {
        counterPresenter.onPlusClick()
    }
    
    override fun showView(count: Int) {
        textCounter.text = "$count"
    }
}

    compile 'com.arello-mobile:moxy:1.5.3'
    compile 'com.arello-mobile:moxy-android:1.5.3'
    compile 'com.arello-mobile:moxy-app-compat:1.5.3'
    kapt 'com.arello-mobile:moxy-compiler:1.5.3'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
vivanov-xcommented, Jun 6, 2017

+1

1reaction
ekursakovcommented, Jun 6, 2017

Тоже есть такая проблема, периодически (иногда через раз) при запуске вылазит ошибка с PresentersBinder, помогает еще раз запустить приложение, даже без очистки.
image Причем классы эти существуют и студия их видит.

Лог сборки: https://gist.github.com/ekursakov/ad91050dd88cda7b0ae9378acd935088

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I always have to clean my solution after I make a ...
It's saying that because the source code has to be built to reflect your new changes. The debugger can't match up the built...
Read more >
Do I need to Clean/Rebuild a project before Debugging ...
My recommendation is: if you are compiling for the updates made only by you locally on the same machine, you should be okay...
Read more >
Build and clean projects and solutions in Visual Studio
Learn how you can build, rebuild, or clean all or some of the projects or project items in a solution.
Read more >
What does it mean to clean a project in Android Studio? - Quora
Cleaning an Android project simply deletes the build directory. It removes the .class files that are generated when you compile your project and...
Read more >
How to clean project with Maven - Mkyong.com
To deploy your project for production, it's always recommended to use “ mvn clean package “, to make sure you always get the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found