Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Include proguard consumer directives for R8 compatibility

Aperta
#72 7 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #148 di @solevic — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
android, java

Direzione di ricerca

Inizia esaminando l’esempio Gson ProGuard collegato nell’issue e la configurazione di packaging della libreria Android. Aggiungi una configurazione Consumer ProGuard contenente le regole Gson indicate, quindi verifica che una build minimizzata con R8 non produca più il crash segnalato “Missing type parameter” durante l’inizializzazione di JWT.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature request
Checklist
  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved

Developers using R8 have encountered minification issues with the use of GSON in JWTDecode.Android - https://github.com/auth0/JWTDecode.Android/issues/49

Describe the ideal solution

JWTDecode.Android can include proguard directives in a consumer configuration file, which will advertise the issue and solve it for most consumers of the library.

In a new consumer proguard config, include the GSON proguard rules for R8 compiled projects.

https://github.com/google/gson/blob/f72824e2e4d0b719331a040a945876145b7c5acc/examples/android-proguard-example/proguard.cfg#L28

Alternatives and current workarounds

Current workaround is for the consuming project to include the proguard directives for R8 compilers themselves, but that is only likely to happen after they discover the issue, research and locate the solution.

Additional context

Users will discover the issue via a crash report in their minified release builds similar to this:

--------- beginning of crash

2023-08-07 13:47:36.054 16347-17602/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: foo_bar, PID: 16347
java.lang.RuntimeException: Missing type parameter.
at com.google.gson.reflect.TypeToken.(SourceFile:10)
at u6.c.(Unknown Source:0)
at com.auth0.android.jwt.JWT.(SourceFile:6)
at v6.i.c(SourceFile:3)
at v6.i$b.onSuccess(SourceFile:2)
at v6.o$a.onSuccess(SourceFile:2)
at w6.g.onResponse(SourceFile:7)
at com.squareup.okhttp.Call$b.execute(SourceFile:6)
at com.squareup.okhttp.internal.NamedRunnable.run(SourceFile:3)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)

Lingua principale
Java
Stelle
457
Fork
81
Merge medio
6h 18m
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di auth0/JWTDecode.Android

Tutte le issue di auth0/JWTDecode.Android

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.