안드로이드/삽질주의
난독화 필수(?) 제외 목록(지속 업데이트 예정)
안드뽀개기
2023. 3. 3. 10:42
반응형
1. tools:keep
Splash 화면에서 ExoPlayer로 .mp4 영상을 재생하는데, release로 빌드 시 영상이 재생되지 않았고, 이를 해결하기 위해서 res/raw 경로에 아래와 같은 파일을 생성하면 된다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources xmlns:tools="http://schemas.android.com/tools" | |
tools:keep="@raw/splash,@raw/splash2" /> |
리소스 파일이 제외되는 이유는
첫번째, build.gradle의 isShrinkResources 속성이 true이고,
두번째, splash.mp4 파일을 R.raw.splash 경로를 통해 가져온 것이 아니라, 아래와 같이 string으로 uri 경로를 가져왔기 때문이다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val onboardingMediaItem: MediaItem | |
get() = MediaItem.fromUri("android.resource://$packageName/raw/onboarding") |
결국, 프로젝트를 필드 했을 때 해당 .mp4 파일이 사용되지 않는다고 판단되었고, 난독화 대상이 되었기 때문에 리소스를 찾지 못하여 영상 재생이 되지 않았다
반응형