[Bug]: App crashes on Android when minifyEnabled true
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- android, java
- Ambito
- mobile-dev
Direzione di ricerca
Usa il progetto di riproduzione IsraelHiking.Web per creare la variante di produzione Android con minifyEnabled true, quindi confronta il crash con le regole keep di Gson elencate per autorizzazioni e fotocamera. Il payload non indica file o test del repository; il lavoro è concluso quando la build Android di produzione non va più in crash con l’offuscamento abilitato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Capacitor Version
Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 8.5.1
@capacitor/core: 8.5.1
@capacitor/android: 8.5.1
@capacitor/ios: 8.5.1
Installed Dependencies:
@capacitor/cli: 8.5.1
@capacitor/android: 8.5.1
@capacitor/core: 8.5.1
@capacitor/ios: 8.5.1
[success] iOS looking great! 👌
[success] Android looking great! 👌
Other API Details
npm: 11.13.0
node: v24.16.0
Platforms Affected
- iOS
- Android
- Web
Current Behavior
Plugins crashes on production builds when obfuscation is enabled, which is now required for feb 2027.
Expected Behavior
No crashes
Project Reproduction
https://github.com/IsraelHikingMap/Site/tree/main/IsraelHiking.Web
Additional Information
I've played around with it and the following rules have solved it:
For all related plugin that uses permissions:
-keep @interface com.getcapacitor.**
The following is needed for the camera plugin, let me know if you want me to open a different issue:
# The camera plugin carries its parameters and its results between the app and the editor as gson
# objects, and neither gson nor the ioncamera-android library that uses it ships rules of its own.
# Gson works over these classes by reflection: it needs the fields to still be there to fill them,
# the @SerializedName on each one to know which json key it answers to, and the generic signature
# of a TypeToken to know what it is building - none of which R8 can see is used. These are gson's
# own documented rules.
-keepattributes Signature
-dontwarn sun.misc.**
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
If there's more information you'd like me to check please let me know.
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 1.3k
- Merge medio
- 3g 10h
- PR unite (30g)
- 10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ionic-team/capacitor
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
ionic-team/capacitor#8616 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ionic-team/capacitor#8601 ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ionic-team/capacitor#8574 ·
-
SystemBars: safe area CSS injection throws "Cannot read properties of null" on startup (Android 16) Apertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ionic-team/capacitor#8530 · 2 commenti ·
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ionic-team/capacitor#8529 ·
Tutte le issue di ionic-team/capacitor
Issue simili
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Daemon passes --experimental-wasm-jspi unconditionally on Node >= 24; Node 26 rejects the flag Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Automattic/studio#4908 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100