2016-08-08 58 views
0

Ich verwende Azure mobile app in meinem neuen Android-Projekt. Wenn ich die App im Debug-Modus starte, funktioniert die Mobile App erfolgreich und ich kann meine neuen Datensätze in meiner Tabelle sehen.Android Proguard abgestürzt, wenn Azure Mobile App verwendet wird

Mein Problem startet, wenn ich eine Apk-Datei mit Proguard erstellt. Es tut mir leid zu sagen, dass ich ein Neuling auf Proguard bin, dann kann ich meine Proguard-Probleme nicht lösen, obwohl ich die Dokumentation auf der offiziellen Proguard-Seite gelesen habe.

So bekomme ich diese Fehler, wenn ich versuche, apk-Datei mit Proguard ohne Proguard-Code zu erstellen.

Warning: com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable 
Warning: com.google.common.base.Absent: can't find referenced class javax.annotation.Nullable 
Warning: com.google.common.base.Ascii: can't find referenced class javax.annotation.CheckReturnValue 
Warning: com.google.common.base.CaseFormat$StringConverter: can't find referenced class javax.annotation.Nullable 
Warning: com.google.common.base.CharMatcher: can't find referenced class javax.annotation.CheckReturnValue 
Warning: com.google.common.base.CharMatcher: can't find referenced class javax.annotation.CheckReturnValue 
Warning: com.google.common.base.CharMatcher: can't find referenced class javax.annotation.CheckReturnValue 

und mehr hundreads Linie ...

Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe 
Warning: com.google.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe 

und mehr hundreads Linie ....

Warning: okio.Okio: can't find referenced class java.nio.file.Files 
Warning: okio.Okio: can't find referenced class java.nio.file.Files 
Warning: okio.Okio: can't find referenced class java.nio.file.Files 
Warning: okio.Okio: can't find referenced class java.nio.file.Path 
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption 
Warning: okio.Okio: can't find referenced class java.nio.file.Path 
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption 
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 
Warning: okio.Okio: can't find referenced class java.nio.file.Path 
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption 
Warning: okio.Okio: can't find referenced class java.nio.file.Path 
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption 
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 

Dann habe ich diese Zeile in meinem proguard.

Danach Android Studio erstellt die Apk jedoch Die App crashed, sobald es begann. Dann untersuche ich die Protokolle, ich habe neue Warnungen gesehen, dass die Farbe weiß ist.

Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory] 
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory] 
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver] 
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException] 
Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames] 
Note: duplicate definition of library class [org.apache.http.params.HttpParams] 
Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams] 
Note: duplicate definition of library class [android.net.http.SslError] 
Note: duplicate definition of library class [android.net.http.HttpResponseCache] 
Note: duplicate definition of library class [android.net.http.SslCertificate$DName] 
Note: duplicate definition of library class [android.net.http.SslCertificate] 
Note: there were 11 duplicate class definitions. 
     (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass) 

Danke für Hilfe.

Antwort

1

@MustafaOlkun, Es scheint, dass die Lösungen für Ihre Probleme auf der troubleshooting Seite von ProGuard gefunden werden können.

Für das Problem Warning: can't find referenced class, siehe http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass.

Für das Problem Note: duplicate definition of library class, siehe bitte http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass.

Ich hoffe, es hilft.

+0

Danke für den Fortschritt, nachdem ich Fabric crahslatics Werkzeug hinzugefügt habe, sah ich, wo meine App abgestürzt ist und ich verstehe, dass ich neue-keep und-keepclassmembers Zeilen für meine einige Java-Dateien hinzufügen müssen, die von Serializeble sind. –