Skip to content

Commit

Permalink
Change to Firebase Crashlytics from Firebase Crash Reporting (getodk#…
Browse files Browse the repository at this point in the history
…2027)

Crashlytics was designated as the official Google crash reporting tool in May 2017 and came out of beta March 2018. Firebase Crash will be retired September 2018.
  • Loading branch information
grzesiek2010 authored and lognaturel committed Apr 10, 2018
1 parent 9a651a4 commit c2585fc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.gms:google-services:3.2.0'
classpath 'org.ow2.asm:asm:6.0' // https://github.com/jacoco/jacoco/issues/639#issuecomment-355424756
classpath 'org.jacoco:org.jacoco.core:0.8.0'
classpath 'io.fabric.tools:gradle:1.25.2'
}
}

Expand Down
9 changes: 5 additions & 4 deletions collect_app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply from: '../config/quality.gradle'
apply from: '../config/jacoco.gradle'

Expand Down Expand Up @@ -98,7 +99,7 @@ android {
}
minifyEnabled(true)
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
resValue("bool", "FIREBASE_CRASH_ENABLED", "false")
resValue("bool", "FIREBASE_CRASHLYTICS_ENABLED", "false")
}
// Release build for the original ODK Collect app
odkCollectRelease {
Expand All @@ -107,12 +108,12 @@ android {
}
minifyEnabled(true)
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
resValue("bool", "FIREBASE_CRASH_ENABLED", "true")
resValue("bool", "FIREBASE_CRASHLYTICS_ENABLED", "true")
}
debug {
debuggable(true)
testCoverageEnabled(true)
resValue("bool", "FIREBASE_CRASH_ENABLED", "false")
resValue("bool", "FIREBASE_CRASHLYTICS_ENABLED", "false")
}
}

Expand Down Expand Up @@ -191,7 +192,7 @@ dependencies {
exclude group: 'org.apache.httpcomponents'
}
implementation group: 'com.google.firebase', name: 'firebase-core', version: '10.0.1'
implementation group: 'com.google.firebase', name: 'firebase-crash', version: '10.0.1'
implementation group: 'com.crashlytics.sdk.android', name: 'crashlytics', version: '2.9.1'
implementation(group: 'com.google.http-client', name: 'google-http-client', version: '1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
Expand Down
4 changes: 2 additions & 2 deletions collect_app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ the specific language governing permissions and limitations under the License.
tools:replace="android:value" /> <!-- integer/google_play_services_version -->

<meta-data
android:name="firebase_crash_collection_enabled"
android:value="@bool/FIREBASE_CRASH_ENABLED" />
android:name="firebase_crashlytics_collection_enabled"
android:value="@bool/FIREBASE_CRASHLYTICS_ENABLED" />

<uses-library
android:name="com.google.android.maps"
Expand Down
2 changes: 1 addition & 1 deletion collect_app/src/main/assets/open_source_licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3>
<b>Firebase Core</b>
</li>
<li>
<b>Firebase Crash</b>
<b>Firebase Crashlytics</b>
</li>
<li>
<b>Google API Client</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import android.view.View;
import android.view.inputmethod.InputMethodManager;

import com.crashlytics.android.Crashlytics;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.google.firebase.crash.FirebaseCrash;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;

Expand Down Expand Up @@ -328,10 +328,10 @@ protected void log(int priority, String tag, String message, Throwable t) {
return;
}

FirebaseCrash.logcat(priority, tag, message);
Crashlytics.log(priority, tag, message);

if (t != null && priority == Log.ERROR) {
FirebaseCrash.report(t);
Crashlytics.logException(t);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</issue>
<issue id="UnusedResources" severity="error">
<ignore path="res/values/dimens.xml"/>
<ignore regexp="ga_trackingId|google_crash_reporting_api_key"/>
<ignore regexp="ga_trackingId|google_crash_reporting_api_key|project_id"/>
</issue>

<issue id="TimberExceptionLogging" severity="error"/>
Expand Down

0 comments on commit c2585fc

Please sign in to comment.