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:
- Created 6 years ago
- Comments:19 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
Тоже есть такая проблема, периодически (иногда через раз) при запуске вылазит ошибка с PresentersBinder, помогает еще раз запустить приложение, даже без очистки.
Причем классы эти существуют и студия их видит.
Лог сборки: https://gist.github.com/ekursakov/ad91050dd88cda7b0ae9378acd935088