Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

fix desugaring Gson/AGP #177

Merged
merged 1 commit into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Config {
val kotlinVersion = "1.3.60"
val kotlinVersion = "1.3.61"
val kotlinStdLib = "stdlib-jdk8"

object BuildPlugins {
Expand All @@ -20,7 +20,8 @@ object Config {
object Libs {
val appCompat = "androidx.appcompat:appcompat:1.1.0"
val timber = "com.jakewharton.timber:timber:4.7.1"
val gson = "com.google.code.gson:gson:2.8.6"
// only bump gson if https://github.com/google/gson/issues/1597 is fixed
val gson = "com.google.code.gson:gson:2.8.5"
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.0-beta-4"
}

Expand Down
7 changes: 6 additions & 1 deletion sentry-android-core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Gson specific classes
-dontwarn sun.misc.**
-keep class com.google.gson.** { *; }
#-keep class com.google.gson.stream.** { *; }
-keep class sun.misc.Unsafe { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class io.sentry.core.** { *; }
Expand All @@ -30,4 +30,9 @@
@com.google.gson.annotations.SerializedName <fields>;
}

# Keep jetbrains annotations
-keep @interface com.jakewharton.nopen.annotation.** { *; }
-keep @interface org.jetbrains.annotations.** { *; }


##---------------End: proguard configuration for Gson ----------
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public void write(final JsonWriter out, final T value) throws IOException {
public T read(final JsonReader in) {
// In its simplest solution, we can just collect a JSON tree because its much easier to
// process
JsonElement jsonElement = JsonParser.parseReader(in);
JsonParser parser = new JsonParser();
JsonElement jsonElement = parser.parse(in);

if (jsonElement == null || jsonElement.isJsonNull()) {
return null;
Expand Down