Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui test mockito issue #53

Closed
junhyung0927 opened this issue Jun 18, 2022 · 0 comments
Closed

ui test mockito issue #53

junhyung0927 opened this issue Jun 18, 2022 · 0 comments

Comments

@junhyung0927
Copy link
Collaborator

  • ui test에서 mockito-kotlin 라이브러리와 dex-inline 라이브러리를 사용할 때 발생하는 이슈

E/TestRunner: java.lang.NullPointerException: Attempt to invoke interface method 'boolean org.mockito.plugins.MockMaker$TypeMockability.mockable()' on a null object reference at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:23) at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:240) at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:228) at org.mockito.internal.MockitoCore.mock(MockitoCore.java:61) at org.mockito.Mockito.mock(Mockito.java:1907) at org.mockito.Mockito.mock(Mockito.java:1816) ...

원인 및 해결 방안

AGP 3.6에 도입된 기본 라이브러리가 페이지가 정렬되고 압축되지 않은 상태로 패키징 됩니다. 이로 인해 앱이 JVMTI에 연결하는데 필요한 기본 라이브러리를 찾을 수 없게 된다.

현재 해결 방법은 androidTest의 하위에 manifest 파일을 추가해주고 android:extractNativeLibs="true" 플래그를 사용해서 테스트 APK에 대해 해당 기능을 해제하면 된다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant