티스토리 뷰

 

아이오닉에서 카카오 플러그인을 설치 후 Android 실행 시 아래와 같은 에러들이 나온다.

에러의 내용들을 상세히 보면 아래와 같다.

TextView textView = convertView.findViewById(KakaoResources.login_method_text); // View cannot be converted
ImageView imageView = convertView.findViewById(KakaoResources.login_method_icon); // View cannot be converted
 
ListView listView = dialog.findViewById(KakaoResources.login_list_view); // View cannot be converted
Button closeButton = dialog.findViewById(KakaoResources.login_close_button); // View cannot be converted


위와 같은 현상은 낮은 complieSdkVersion 문제이며, 호환성을 위해 작업이 필요하다.

경로: /plugins/cordova-plugin-kakao-sdk/src/android/KakaoCordovaSDK.java 파일을 열은 후 

위의 내용들을 찾아 아래와 같이 수정해준다.

TextView textView = (TextView) convertView.findViewById(KakaoResources.login_method_text);
ImageView imageView = (ImageView) convertView.findViewById(KakaoResources.login_method_icon);
 
ListView listView = (ListView) dialog.findViewById(KakaoResources.login_list_view);
Button closeButton = (Button) dialog.findViewById(KakaoResources.login_close_button);


그리고 다시 실행을 하면 오류가 해결 된 것을 볼 수 있다.

이 오류 관련하여 수정하여 git에 올려놓았다.

https://github.com/JinwooPark94/cordova-plugin-kakao-sdk

감사합니다.

오늘도 해피 코딩하세요.

댓글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
최근에 올라온 글
Total
Today
Yesterday