1. 오류상세

   -  java.lang.IllegalStateException: Room cannot verify the data integrity. 

      Looks like you've changed schema but forgot to update the version number.

      You can simply fix this by increasing the version number.

 

2. 사용 Libaray 및 기능

   - Room

 

3. 발생이유

   - 생성했던 database안에 테이블 및 컬럼들이 변경 되었는데 소스상에서 변경된 상황을 App에게 알려주지 않았기 때문이다.

    - 발생이유 상세예제

      아래 *1차버전 소스에서 보면 history table을 하나만 관리하다가

              *2차버전 소스에서 review table 을 하나 추가 했는데 이때 version을 증가시키지 않았기 때문에 오류가 발생한다.

9. 해결방법 - 1

    - database version을 올려주고, Migration( ) 작업을 해준다.

    - script (AppDatabase.kt)

Posted by 농부지기
,

1. 오류상세

   - E/part3.chapter0: Unknown bits set in runtime_flags: 0x8000
     E/RecyclerView: No adapter attached; skipping layout

 

2. 사용 Libaray 및 기능

   - RecyclerView

   - binding

 

3. 발생이유

   - RecyclerView 사용기능 확인

   - binding 기법 확인 

9. 해결방법 - 1

   - getItemCount() 함수에서 return 시 size 확인

       Log를 이용해서 size가 정확히 return 되는지 확인 한다.

   - Adapter를 ListAdapter로 상속받아서 개발하면 getItemCount( ) 메서드를 생성하지 않아도 된다.

    - script

    public int getItemCount() {

        Log.d("size", data.size())
        return data.size();
    }

 

9. 해결방법 - 2

     - Adapter class는 정상적이라고 생각 하고...  

       Adapter class와 RecyclerView를 연결하는 부분을 확인한다.

     - 거의 layoutManager를 생성하지 않았을 경우에 위와 같은 오류가 발생한다.

     - 참고, layoutManager는 kotlin소스 내부에서도 할 수 있자만 View속성에서도 지정할 수 있다.

        <androidx.recyclerview.widget.RecyclerView

                 android:id="@+id/rv_list"

                 app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

     - script

    private lateinit var adapter: BookAdapter
    private fun initBookRecyclerView() {
        adapter = BookAdapter()
        binding.bookRecyclerView.layoutManager = LinearLayoutManager(this)
        binding.bookRecyclerView.adapter = adapter
    }

 

9. 해결방법 - 3

    - binding 방식으로 개발 했으면서 setContentView에 binding방식으로 변경하지 않은 경우

    - default MainActivity.kt는 setContentView(R.id.activity_main) 으로 되어 있는데

      이것을 binding방식으로 개발할 때는 setContentView(binding.root)로 변경해야 된다.

    - RecyclerView를 사용하면서 binding.root로 변경하지 않으면 위와 같은 오류가 발생한다.

    - script

       private lateinit var binding: ActivityMainBinding
       binding = ActivityMainBinding.inflate(layoutInflater)
       setContentView(binding.root)

 

 

Posted by 농부지기
,

NoConnectionError. ClearTextHTTP traffic

 

1. 오류상세

   - No type arguments expected for class Call

 

2. 사용 Libaray

   - retrofit

 

3. 발생이유

   - return : Call<Dto> 을 기술하면 자동 import가  "android.telecom.Call" 이 된다.

4. 해결방안

   - import retrofit2.Call     로 해주면 정상수행 된다.

Posted by 농부지기
,

NoConnectionError. ClearTextHTTP traffic

 

1. 오류상세

   - com.android.volley.NoConnectonError: java.io.IOException:

     ClearText HTTP traffic to192.168.000.000 not permitted

 

2. 사용 Libaray

   - volley

 

3. 발생이유

   - 예전에는 http호출로 인터넷이 접속 되었지만 google정책변경으로

     http접속을 차단하고 https만 가능하도록 했다.

   - SDK 28버전 부터 https를 통한 연결만 가능하도록 했다.

 

4. 해결방안

   - 보안 연결인 TLS(Transport Layer Security)연결을 사용 해야 한다.

   - 관련 Link.

   - 방안1: 장점 : 모든 ip 가능

             : Manifest.xml 파일의 Application내에

              android:userClearTextTraffic="true" 를 추가하면

              http 연결을 허용하게 된다.

   - 방안2: 단점 - 저장한 ip만 가능

             : 파일생성 - res>xml>network_security_config.xml
             : 파일내용 -

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">192.168.000.000</domain>
    </domain-config>
</network-security-config>

            :  Manifest.xml 파일의 Application내에

               android:networkSecurityConfig="@xml/network_security_config"

 

..

 

Posted by 농부지기
,