kotlin.UninitializedPropertyAccessException:lateinit属性textInput尚未初始化”

时间:2019-12-28 12:45:17

标签: kotlin

我是android开发的新手,我试图在手机中运行一个开源应用程序,但它崩溃了, 我得到的错误是

kotlin.UninitializedPropertyAccessException: lateinit property textInput has not been initialized
        at org.ligi.survivalmanual.ui.MainActivity.access$getTextInput$p(MainActivity.kt:50)

维护活动中的错误查找区域

class MainActivity : BaseActivity() {


    private val drawerToggle by lazy { ActionBarDrawerToggle(this, drawer_layout, drawer_open, drawer_close) }

    private val survivalContent by lazy { SurvivalContent(assets) }

    private lateinit var currentUrl: String
    private lateinit var currentTopicName: String


    private var lastFontSize = State.getFontSize()
    private var lastNightMode = State.nightModeString()
    private var lastAllowSelect = State.allowSelect()
    private lateinit var textInput: MutableList<String>

    private val linearLayoutManager by lazy { LinearLayoutManager(this) }

我知道我应该从github 执行git子模块的初始化/更新,但是仍然不确定如何做到这一点,请有人帮忙使此应用运行!请...。我是android新手!

1 个答案:

答案 0 :(得分:0)

在项目的根文件夹中打开终端(如果您是从github克隆的,则应将其称为“ SurvivalManual”)并执行:

git submodule init
git submodule update

重建项目。