简体   繁体   中英

Problems obfuscating Android application that uses Spring for Android

I'm using Spring for Android in my application, and I'm trying to obfuscate/optimize/shrink using Proguard. I'm getting the following exception at runtime:

Caused by: org.springframework.web.client.RestClientException: Could not write request: no suitable HttpMessageConverter found for request type [com.mycompany.myproduct.AuthenticateRequest] and content type [application/json] at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:610) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:449) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:414) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:390)

I'm guessing there's some things I need to -keep in my proguard.cfg file, but I can't seem to figure out what they might be.

In my proguard.cfg file I added the following, and it did the trick:

-keep class org.springframework.** { *; }
-keep class org.codehaus.jackson.** { *; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM