본문 바로가기

Android/오류해결

(6)
[Android] Robolectric 을 활용한 유닛테스트 resources 에서 가져온 스트링값, 서버에서 내려준 필드를 조합하여 특정 스트링을 만드는 클래스가 있는데 이에 대한 유닛테스트 코드를 짜려고 한다. 유닛테스트에서는 안드로이드 프레임워크에 의존성이 있는 클래스들을 참조할 수 없다. 이유는 그냥 Robolectric 검색하면 다양한 포스팅이 있으니 참고할 것. 아무튼 위와 같은 이유로 resources 참조를 위해 Robolectric 을 사용하면서 나온 빌드 에러, 해결방법 등을 대충 정리해두려고 한다. (발견하면 추가할 것) 오류1) 빌드 실패 Failed to transform artifact 'bcprov-jdk15on.jar (org.bouncycastle:bcprov-jdk15on:1.68)' to match attributes {artif..
[Android] CoodinatorLayout 사용시 만났던 에러 app:layout_behavior="app:layout_behavior="@string/appbar_scrolling_view_behavior" not found 그냥 머티리얼 디자인 디펜던시 추가해주면 된다. 해당 스트링 리소스는 기본 탑재가 아니고 머티리얼에 들어가있다. 그냥 Coordinator 랑 같이 있어주면 덧났던걸까..? implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0" implementation "com.google.android.material:material:1.3.0"
[Android] kotlin extension 관련 compile error 입사 초기에 코틀린 익스텐션 뷰 아이디를 덩그러니 뒀을 때 아래와같은 컴파일 에러가 발생했었다. e: java.lang.IllegalStateException: Backend Internal error: Exception during code generation Cause: Back-end (JVM) Internal error: wrong code generated org.jetbrains.kotlin.codegen.CompilationException Back-end (JVM) Internal error: Couldn't transform method node: ... Cause: Error at instruction #125 GOTO L0: Incompatible stack heights Elemen..
[Android Studio] xcrun: error: invalid active developer path xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun 원인 : Max os 를 업데이트하고나서 자주 발생하는 오류라고한다. 안드로이드 스튜디오에서 git 을 사용할 수 없었고(Annotate 나 브랜치 관련 작업 등), 검색해보면 주로 XCode에서도 발생하는 오류라고한다. 해결방법 : Git 을 새로 설치하고 version controll - git configuration 에서 git 이 설치된 경로를 적어주면 된다. /usr/local/git/bin/git 참고 : https://sta..
[Android] Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant). Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant). 머티리얼 컴포넌트 테마도 extend 하려고했더니 없다면서 안되고, 이미 있는 테마 갖다쓰려니 똑같이 안되고결국 공식 문서에 다 나와있었는데 영어 해석이 안돼서 삽질이 오래됐다;;; 공식문서 : https://material.io/develop/android/docs/getting-started/ 그래들도 추가하고 하라는거 다했는데 중요한 4번을 빼먹어서 문제였다.4. Change your app theme to inherit from a M..
[Android] android.os.FileUriExposedException 글 업데이트 날짜 21.07.19 문제상황 Intent 를 이용해 카메라 앱을 찾아 사진을 촬영하여 imageView 에 띄우는 예제를 하던 중에 문제가 발생했다. (인텐트에 파일을 저장할 경로가 Uri 그대로 노출되어있었음) 에러 android.os.FileUriExposedException: file:///storage/emulated/0/capture.jpg exposed beyond app through ClipData.Item.getUri() 에러 발생 이유(공식 문서 한국어 번역) Target SDK 가 android 7.0(24) 이상인 앱의 경우, Android 프레임워크는 앱 외부에서 file:// URI가 노출되는 것을 금지하는 StrictMode API 정책을 적용합니다. 파일 URI..