Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/crashlytics/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ project.ext {
])
}

apply from: file('./../../app/android/firebase-json.gradle')

// Default to 'false' for the feature due to memory usage concerns
String crashlyticsNdkEnabled = 'false'

if (rootProject.ext && rootProject.ext.firebaseJson) {
def rnfbConfig = rootProject.ext.firebaseJson

// Allow users to opt-in to NDK crash reporting (or whatever feature)
if (rnfbConfig.isFlagEnabled('crashlytics_ndk_enabled', false) == true) {
crashlyticsNdkEnabled = 'true'
}
}

android {
def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
if (agpVersion >= 7) {
Expand All @@ -65,6 +79,9 @@ android {

defaultConfig {
multiDexEnabled = true
manifestPlaceholders = [
firebaseJsonCrashlyticsNdkEnabled: crashlyticsNdkEnabled
]
}

buildFeatures {
Expand Down
12 changes: 12 additions & 0 deletions packages/crashlytics/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />

<!-- NDK crash reporting - disabled by default due to memory impact -->
<!-- Example (in Firebase.json): {
"react-native": {
"crashlytics_ndk_enabled": true
}
}
-->
<meta-data
android:name="firebase_crashlytics_ndk_enabled"
android:value="${firebaseJsonCrashlyticsNdkEnabled}" />

<provider
android:name="io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsInitProvider"
android:authorities="${applicationId}.reactnativefirebasecrashlyticsinitprovider"
Expand Down
Loading