akexorcist / GoogleDirectionLibrary

[Android] Library for Google Direction API for Google Maps Android API v2
Apache License 2.0
571 stars 174 forks source link

progurd error #20

Closed Hoosein closed 7 years ago

Hoosein commented 8 years ago

while proguard is true

Process: com.kama.khajoie.sirjan118, PID: 3179
                                                                          java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                                                                              at com.akexorcist.googledirection.model.Direction.b(Unknown Source)
                                                                              at com.kama.khajoie.sirjan118.Test.a(Unknown Source)
                                                                              at com.akexorcist.googledirection.b.d.a(Unknown Source)
                                                                              at c.u.run(Unknown Source)
HongSquare2 commented 8 years ago

Having this issue too. Anyone with any solutions? Thanks.

Manugal commented 7 years ago

Same problem here. +1

Not sure, but it seems it happens on pre-Lollipop devices.

akexorcist commented 7 years ago

@Hoosein I think it isn't related with ProGuard. It's some bug in my library that occurred in your production app accidentally. (It can be happen without ProGuard)

Please update to version 1.0.5 to fix this problem.

Thank you for your feedback

D00mch commented 7 years ago

I had the same problem with 1.0.4 after setting ProGuard. 1.0.5 didn't work with ProGuard either (except it didn't throw NullPointerException).

I fixed it by adding several lines in proguard-rules.pro file:

-keep class com.akexorcist.* { ; } -keep interface com.akexorcist.* { ; }

-keep class com.google.android.gms.maps.* { ; } -keep interface com.google.android.gms.maps.* { ; }