안드로이드/Debug

Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number.
원인 Room에서 스키마 바꾸고 바로 실행하면 볼 수 있는 오류. 무결성 침해됬다고 나오는 오류다. 해결 방법은 2가지다. 배포 전 휴대폰 설정 -> 애플리케이션 -> "본인이 만든앱" -> 저장공간 -> 데이터 삭제 로 직접 로컬 DB를 날려버리면 된다.(권장) 배포 후 만일 배포된 어플이라면 데이터베이스 마이그레이션을 통해 데이터베이스 버전을 높일 수 있다.

Cannot figure out how to save this field into database. You can consider adding a type converter for it.
원인 Room이 필드 타입을 인식하지 못해서 발생하는 문제, 보통 코틀린의 Basic Type이 아닌 직접 만든 데이터 클래스 리스트를 사용할 때 발생 Entity 클래스 @Entity(tableName = "checklist") data class CheckListEntity( @ColumnInfo(name = "checklist_info") var checkLists: List ){ @PrimaryKey(autoGenerate = true) var idx: Long = 0 } 데이터 클래스 data class CheckListInfo( //할 일 var checklistContent: String, //초기화 요일 var restartWeek: Set, //수행여부 var done: Boolean =..

Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.10 (org.jetbrains.kotlin:kotlin-stdlib:1.8.10) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
원인 의존성 문제이거나 코틀린 버전 문제 중 하나 해결 프로젝트 build.gradle의 코틀린 버전을 변경 id 'org.jetbrains.kotlin.android' version '1.7.20' apply false 아래로 변경 id 'org.jetbrains.kotlin.android' version '1.8.10' apply false 버전에 맞춰서 코틀린 컴파일러도 변경 아래 사이트 참고 https://developer.android.com/jetpack/androidx/releases/compose-kotlin

java.lang.NullPointerException: null cannot be cast to non-null type androidx.navigation.fragment.NavHostFragment
원인 BottomNavigation을 추가하던 중 val navHostFragment = supportFragmentManager.findFragmentById(R.id.fragmentContainer) as NavHostFragment 해결 private fun setBottomNav(){ val navHostFragment = supportFragmentManager.findFragmentById(R.id.fragmentContainer) as NavHostFragment //바텀 네비게이션에 들어갈 네비게이션 컨트롤러 정의 val navController = navHostFragment.findNavController() binding.bottomNav.setupWithNavController(na..

RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{dcc7ca6 u0 com.***.***/.ble.BleService}
원인 서비스에서 startForeground 호출 시점이 꼬이면 발생하는 예외 해결 onStartCommand() 에서 호출하던 startFroeground를 onCreate() 로 변경 private fun createNotificationChannel() { ... startForeground(NOTIFICATION_ID, notification) } broadcastUpdate(BleObject.START_FOREGROUND_SERVICE, "startForegroundService") } override fun onCreate() { super.onCreate() createNotificationChannel() } override fun onStartCommand(intent: Intent?, ..

--- Failed to create image decoder with message 'unimplemented'
원인 Glide SVG이미지 로드 시 발생하는 에러, 버전에 따라 앱이 다운되는 경우도 있다. Glide.with(requireContext()).load(R.drawable.ic_sunny).into(binding.weatherIv) 해결 drawable 정수값 대신 ContextCompat.getDrawable로 호출 fun setImage(drawable: Int){ val image = ContextCompat.getDrawable(requireContext(), drawable) as VectorDrawable Glide.with(requireContext()).load(image).into(binding.weatherIv) } 참고 안드로이드 Glide SVG 이미지 로드 관련 오류 해결 - ..

Caused by: java.lang.IllegalArgumentException: Char / is not a decimal digit
원인 StringBuilder에서 get한 값을 바로 digitToInt 했을 때 나온 에러입니다. if(sb[1].digitToInt() == 9) 해결 String -> Int 로 String을 한 번 거쳐줬습니다. if(sb[1].toString().toInt() == 9)

SDK location not found
원인 Git에서 프로젝트를 Pull 했는데 SDK 위치를 찾지 못함. 맥 -> 윈도우로 받아서 \, / 차이로 인한 오류라고 판단됩니다. 해결 방법 PC에서 sdk의 위치를 찾아 local.properties 파일에 넣어주면 됩니다. 만약 local.properties가 없다면 만들어주면 됩니다.