mapbox / mapbox/mapbox-java

Mapbox-java incompatible with gson 2.13.0 and up - call to internal GSON classes that were renamed

オープン
#1,614 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
438
フォーク
117
PR マージ指標
30日以内にマージされた PR はありません

説明

Attempted upgrading GSON (for internal app use and third-party integration requiring a newer version), but encountered issues with mapbox-java. R8 began reporting missing classes due to the following reference:

https://github.com/mapbox/mapbox-java/blob/977651247bcd5dd642de1dd5fd3093d00152099b/services-geocoding/src/main/java/com/mapbox/api/geocoding/v5/SingleElementSafeListTypeAdapter.java#L6

The root cause is the renaming of internal classes in GSON version 2.13.0:

The internal classes $Gson$Types and $Gson$Preconditions have been renamed to remove the $ characters. Since these are internal classes (as signaled not only by the package name but by the $ characters), client code should not be affected. If your code was depending on these classes then we suggest making a copy of the class (subject to the license) rather than depending on the new names.

r8 error:

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in REDACTED/missing_rules.txt.
ERROR: R8: Missing class com.google.gson.internal.$Gson$Types (referenced from: com.google.gson.TypeAdapter com.mapbox.api.geocoding.v5.SingleElementSafeListTypeAdapter$1.create(com.google.gson.Gson, com.google.gson.reflect.TypeToken))

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

services-geocoding/src/main/java/com/mapbox/api/geocoding/v5/SingleElementSafeListTypeAdapter.java の参照されている import から始め、その GSON の使用方法を GSON 2.13.0 のリリースノートと比較します。GSON 2.13.0 以降で R8 の missing-class エラーを再現し、その後、geocoding サービスがそのエラーなしでビルドされることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
mobile-dev
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。