当我使用minifyEnabled应用程序时不断崩溃

时间:2019-05-26 09:49:39

标签: android proguard minify android-proguard

最近我开发了一个android应用。 一切顺利,但是当我使用“ minifyEnabled true”应用时,继续崩溃并显示此错误:

com.google.gson.internal.LinkedTreeMap$1
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1344)
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)
java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)
java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
org.matrix.androidsdk.data.cryptostore.db.HelperKt.serializeForRealm(:102)
org.matrix.androidsdk.data.cryptostore.db.model.DeviceInfoEntity.putDeviceInfo(:43)
org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore$storeUserDevices$1.invoke(:244)
org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore$storeUserDevices$1.invoke(:44)
org.matrix.androidsdk.data.cryptostore.db.HelperKt$doRealmTransaction$1.execute(:86)
io.realm.Realm.a(:1493)
org.matrix.androidsdk.data.cryptostore.db.HelperKt.doRealmTransaction(:86)
org.matrix.androidsdk.data.cryptostore.db.RealmCryptoStore.storeUserDevices(:228)
org.matrix.androidsdk.crypto.MXDeviceList$4$1.run(:605)
android.os.Handler.handleCallback(Handler.java:815)
android.os.Handler.dispatchMessage(Handler.java:104)
android.os.Looper.loop(Looper.java:227)
android.os.HandlerThread.run(HandlerThread.java:61)

我在proguard配置文件中尝试了许多更改,但是问题仍然存在

1 个答案:

答案 0 :(得分:0)

看起来Proguard无法正确处理LinkedTreeMap。尝试添加规则以将此类跳过应用程序文件夹内的proguard-rules.pro文件

-keep class [full class name] { *; }