에러발생과정
AndroidManifest.xml 파일 수정진행중 파일을 잘못건드린것으로 추정 …
에러내용
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property prefs has not been initialized
at com.interline.jewellery.common.MyApplication$Companion.getPrefs(MyApplication.kt:9)
at com.interline.jewellery.LivePreviewActivity.onCreate(LivePreviewActivity.kt:101)
at android.app.Activity.performCreate(Activity.java:7963)
at android.app.Activity.performCreate(Activity.java:7952)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3629)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3806)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
에러원인과 해결
<application 속성중 name이 빠져있었고, 해당 name속성의 내용을 채워줌으로 에러가 사라짐
참고자료
https://stackoverflow.com/questions/51295035/kotlin-android-shared-preferences-lateinit-property-prefs-has-not-been-initial
댓글