SW-Marastro / MyKkumi-Android

[Android] 마이꾸미 | 템빨 취미 및 제품 정보 공유 서비스 | 💻 SW Maestro 15th
7 stars 0 forks source link

[FIX] KKUMI-110 : 난독화 문제 해결 #82

Open jung0115 opened 1 month ago

jung0115 commented 1 month ago

어떤 버그인가요?

난독화 시 apk 빌드 앱이 제대로 동작하지 않는 문제

어떤 상황에서 발생한 버그인가요?

[ Given ] 난독화 처리 (minifyEnabled true) [ When ] release apk build [ Then ] 정상적으로 앱이 빌드 및 실행되어야 한다 앱이 제대로 실행되지 않고, 모듈간 의존하는 함수, view를 제대로 찾지 못하는 것으로 보임

예상 결과

앱 실행 및 구현 기능 동작

참고할만한 자료(선택)

jung0115 commented 1 month ago

R8 task fails with missing StringConcatFactory

jung0115 commented 4 weeks ago

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /home/runner/work/MyKkumi-Android/MyKkumi-Android/core/common-ui/build/outputs/mapping/release/missing_rules.txt.

ERROR: R8: Missing class java.lang.invoke.StringConcatFactory (referenced from: void com.swmarastro.mykkumi.common_ui.permission.ImagePermissionUtils.captureWithCamera(android.content.Context, androidx.activity.result.ActivityResultLauncher, kotlin.jvm.functions.Function1) and 3 other contexts)

jung0115 commented 4 weeks ago

임시

common-ui > proguard-rules.pro

-keep class java.lang.invoke.StringConcatFactory { *; }

gradle.properties

android.enableR8.fullMode=false
android.enableR8.libraries=false
jung0115 commented 4 weeks ago

문제

FAILURE: Build failed with an exception.

  • Where: Build file '/home/runner/work/MyKkumi-Android/MyKkumi-Android/app/build.gradle' line: 2

  • What went wrong: An exception occurred applying plugin request [id: 'com.android.application']

    Failed to apply plugin 'com.android.internal.application'. The option 'android.enableR8.libraries' is deprecated. The current default is 'true'. It was removed in version 7.0 of the Android Gradle plugin.

원인

android.enableR8.libraries=false
jung0115 commented 4 weeks ago

android.enableR8.fullMode=false


✅ 더 좋은 방법이 있을지 찾아볼 것