Skip to content

Conversation

@HI-JIN2
Copy link
Member

@HI-JIN2 HI-JIN2 commented May 28, 2025

Summary

  • 릴리즈 모드일 때만 Crashlytics, Analytics 수집 되도록 수정하였습니다.
    • BuildConfig의 DEBUG (불리언값)을 활용하여 구분하였습니다.

Describe your changes

실물 기기 테스트가 필요합니다.

@HI-JIN2 HI-JIN2 self-assigned this May 28, 2025
@HI-JIN2 HI-JIN2 requested review from Copilot and kangyuri1114 May 28, 2025 08:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures Firebase Crashlytics and Analytics data collection only occur in release builds by leveraging build config flags and conditional runtime checks.

  • Added conditional logic in App.kt to disable collection in debug and enable in release.
  • Updated Gradle build setup to enable code shrinking in release and define ENABLE_CRASHLYTICS build config flags per build type.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/src/main/java/com/eatssu/android/App.kt Toggle Crashlytics and Analytics collection using BuildConfig.DEBUG checks
app/build.gradle.kts Enable isMinifyEnabled for release, set up ENABLE_CRASHLYTICS flags, and incorrectly declare shrinkResources
Comments suppressed due to low confidence (2)

app/src/main/java/com/eatssu/android/App.kt:39

  • You’ve added ENABLE_CRASHLYTICS build config flags in Gradle, but the runtime check still uses BuildConfig.DEBUG. Consider replacing this with BuildConfig.ENABLE_CRASHLYTICS (and a similar flag for analytics) to match your build config definitions.
if (BuildConfig.DEBUG) {

app/build.gradle.kts:49

  • shrinkResources should be set using the Gradle property isShrinkResources, not a local variable. Update this line to isShrinkResources = false (and isShrinkResources = true in release if desired).
var shrinkResources = false

getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
buildConfigField("Boolean", "ENABLE_CRASHLYTICS", "true")
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The flag name ENABLE_CRASHLYTICS is used for both Crashlytics and Analytics. For clarity, consider defining separate flags (e.g., ENABLE_ANALYTICS) or renaming to something more general like ENABLE_FIREBASE_COLLECTION.

Suggested change
buildConfigField("Boolean", "ENABLE_CRASHLYTICS", "true")
buildConfigField("Boolean", "ENABLE_CRASHLYTICS", "true")
buildConfigField("Boolean", "ENABLE_ANALYTICS", "true")

Copilot uses AI. Check for mistakes.
Copy link
Member

@kangyuri1114 kangyuri1114 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿 신경 안썼던 gradle 다시 보게 되네요

isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")

var shrinkResources = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var 필요 없지 않나요??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var shrinkResources요? 없으면 에러나던디

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

허허 그렇네요 왜징

Copy link
Member

@kangyuri1114 kangyuri1114 Jun 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var shrinkResources = false
이렇게 하면 그냥 안쓰는 변수를 코틀린으로 선언한거고
image

사진처럼 해야 하는 것 같아요
https://developer.android.com/build/migrate-to-kotlin-dsl

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영했습니다!

@HI-JIN2 HI-JIN2 merged commit 4a2b2c1 into develop Jun 1, 2025
1 check passed
@HI-JIN2 HI-JIN2 deleted the fix/not-write-log-in-debug branch June 1, 2025 05:35
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

Successfully merging this pull request may close these issues.

3 participants