Autore Topic: Proguard errore in export APK  (Letto 1009 volte)

Offline ignaz

  • Utente junior
  • **
  • Post: 54
  • Respect: +2
    • Mostra profilo
  • Dispositivo Android:
    Galaxy s2
  • Sistema operativo:
    Win 7 64bit
Proguard errore in export APK
« il: 04 Aprile 2014, 09:09:15 CEST »
0
Aiuto, dopo aver inserito le API di google il mio progetto include proguard.
Quando eseguo in debug l'applicazione o compilo nessun problema se provo ad esportare il file APK con la keistore ho l'errore sotto.
Ho provato a inserire nel file di configyurazione di proguard la stringa -dontwarn javax.xml.stream.** il file viene esportato correttamente senza erroere. Ma quando eseguo la mia app sul mio smartphone l'app si chiude!  Credo che non venga caricata il jar che contiene javax....
Qualcuno mi può aiutare ripeto in debug funziona tutto perfettamente sia su device che su emulatore.
E' possibile eventualmente escludere proguard?
ho provatao anche ad inserire la stringa:
-libraryjars libs\simple-xml-2.7.1.jar per forzare il caricamento della libreria ma nulla da fare...
IL problema è che la libreria simple-xml ha dei riferimenti alla libreria javax.... e questa non  è inclusa nei Jar di android.
Ma come faccio a risolvere?

Aiuto

Grazie

Codice (Java): [Seleziona]
[2014-04-04 08:58:00 - Ricettario] Proguard returned with error code 1. See console
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can't find referenced class javax.xml.stream.XMLInputFactory
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can'
t find referenced class javax.xml.stream.XMLInputFactory
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can't find referenced class javax.xml.stream.XMLInputFactory
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can'
t find referenced class javax.xml.stream.XMLInputFactory
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can't find referenced class javax.xml.stream.XMLInputFactory
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can'
t find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamProvider: can't find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.XMLEventReader
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Entry: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Entry: can'
t find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Entry: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Entry: can'
t find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Entry: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Entry: can'
t find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.Location
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can'
t find referenced class javax.xml.stream.events.StartElement
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.events.StartElement
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.Location
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can'
t find referenced class javax.xml.stream.events.StartElement
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.events.StartElement
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can'
t find referenced class javax.xml.stream.Location
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Start: can't find referenced class javax.xml.stream.events.Attribute
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can't find referenced class javax.xml.stream.events.Characters
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can't find referenced class javax.xml.stream.events.Characters
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can'
t find referenced class javax.xml.stream.events.Characters
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can't find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario] Warning: org.simpleframework.xml.stream.StreamReader$Text: can'
t find referenced class javax.xml.stream.events.XMLEvent
[2014-04-04 08:58:00 - Ricettario]       You should check if you need to specify additional program jars.
[2014-04-04 08:58:00 - Ricettario] Warning: there were 54 unresolved references to classes or interfaces.
[2014-04-04 08:58:00 - Ricettario]          You may need to specify additional library jars (using '-libraryjars').
[2014-04-04 08:58:00 - Ricettario] java.io.IOException: Please correct the above warnings first.
[2014-04-04 08:58:00 - Ricettario]      at proguard.Initializer.execute(Initializer.java:321)
[2014-04-04 08:58:00 - Ricettario]      at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-04-04 08:58:00 - Ricettario]      at proguard.ProGuard.execute(ProGuard.java:86)
[2014-04-04 08:58:00 - Ricettario]      at proguard.ProGuard.main(ProGuard.java:492)
« Ultima modifica: 04 Aprile 2014, 11:02:52 CEST da ignaz »

Offline undead

  • Utente senior
  • ****
  • Post: 666
  • Respect: +113
    • Mostra profilo
  • Dispositivo Android:
    Samsung Galaxy S6
  • Play Store ID:
    DrKappa
  • Sistema operativo:
    Windows 10 64-bit, Windows 8.1 64-bit
Re:Proguard errore in export APK
« Risposta #1 il: 04 Aprile 2014, 11:10:11 CEST »
0
Se stai usando eclipse e includendo librerie esterne c'è un "trucco".
Disabilita la build automatica. Fai clean+build delle librerie. Fai clean+build del progetto. Poi esporta con proguard.

Su 3 macchine di sviluppo su una non riesco a fare il sign se non faccio così. Sulle altre due anche se è attivo build automatically funziona.

Stesso progetto, stessa versione di eclipse, stessa versione dell'sdk.

Prossimamente su Voyager.  :D

Offline ignaz

  • Utente junior
  • **
  • Post: 54
  • Respect: +2
    • Mostra profilo
  • Dispositivo Android:
    Galaxy s2
  • Sistema operativo:
    Win 7 64bit
Re:Proguard errore in export APK
« Risposta #2 il: 04 Aprile 2014, 12:06:40 CEST »
0
Si utilizzo eclipse proverò, ma cosa intendi per esporta con proguard? C'è un comando?

Inviato dal mio Nexus 10 utilizzando Tapatalk


Offline undead

  • Utente senior
  • ****
  • Post: 666
  • Respect: +113
    • Mostra profilo
  • Dispositivo Android:
    Samsung Galaxy S6
  • Play Store ID:
    DrKappa
  • Sistema operativo:
    Windows 10 64-bit, Windows 8.1 64-bit
Re:Proguard errore in export APK
« Risposta #3 il: 04 Aprile 2014, 16:51:12 CEST »
0
Per esporta con proguard intendo semplicemente esportare l'apk firmato e poi avere proguard abilitato nel file di configurazione progetto. :)

Offline ignaz

  • Utente junior
  • **
  • Post: 54
  • Respect: +2
    • Mostra profilo
  • Dispositivo Android:
    Galaxy s2
  • Sistema operativo:
    Win 7 64bit
Re:Proguard errore in export APK
« Risposta #4 il: 07 Aprile 2014, 09:29:17 CEST »
0
Purtroppo non si risolve!!

Ho provato di tutto e molte imprecazioni....

se disabilito proguard dal file di configurazione poi i servizi Google, in particolare DRIVE non funzionano!
Se abilito proguard  in debug funziona tutto perfettamente se Esporto con la keystore
mi tornano tutti i warnig sopra descritti.
Se dico a proguard di ignorare i wornig compila correttamente con la kayStore, ma se eseguo l'applicazione va in errore!

Qualcuno è mi può aiutare? Sono disperato, mi manca solo l'esporatzione dell'apk per pubblicare il mio progetto!

Offline Bezzu

  • Nuovo arrivato
  • *
  • Post: 2
  • Respect: 0
    • Mostra profilo
Re:Proguard errore in export APK
« Risposta #5 il: 28 Novembre 2014, 12:25:04 CET »
0
Ciao,
mi trovo nella tua stessa situazione. Sei più riuscito a risolvere il problema? come hai configurato il proguard-project.txt?

Ciao Grazie mille

Offline ignaz

  • Utente junior
  • **
  • Post: 54
  • Respect: +2
    • Mostra profilo
  • Dispositivo Android:
    Galaxy s2
  • Sistema operativo:
    Win 7 64bit
Re:Proguard errore in export APK
« Risposta #6 il: 10 Dicembre 2014, 14:18:13 CET »
0
No. Sono Passato a android studio e li funziona tutto perfettamente

Offline Bezzu

  • Nuovo arrivato
  • *
  • Post: 2
  • Respect: 0
    • Mostra profilo
Re:Proguard errore in export APK
« Risposta #7 il: 10 Dicembre 2014, 14:27:37 CET »
0
Ciao,
grazie per la risposta... alla fine io ho risolto aggiungendo al file proguard-project.txt le seguenti righe:

-libraryjars libs/simple-xml-2.7.1.jar
# (3)Not remove unused code
-dontshrink

# (2)Simple XML
-keep public class org.simpleframework.**{ *; }
-keep class org.simpleframework.xml.**{ *; }
-keep class org.simpleframework.xml.core.**{ *; }
-keep class org.simpleframework.xml.util.**{ *; }
# (1)Annotations and signatures

#questa riga va aggiunta per ogni classe che utilizza la libreria
-keep public class com.test.test.**{ *; }

-keepattributes *Annotation*
-keepattributes Signature
-keepattributes ElementList, Root
-keepattributes Element
-keepattributes SourceFile,LineNumberTable

-dontwarn javax.xml.stream.XMLInputFactory
-dontwarn javax.xml.stream.XMLEventReader
-dontwarn javax.xml.stream.XMLEvent
-dontwarn javax.xml.stream.events.XMLEvent
-dontwarn javax.xml.stream.events.Attribute
-dontwarn javax.xml.stream.Attribute
-dontwarn javax.xml.stream.Location
-dontwarn javax.xml.stream.events.StartElement
-dontwarn javax.xml.stream.events.Characters

magari può servire a qualcuno...

Ciao