GSON + HTC Desire: Conflict. Possible solution jarjar.jar causes error

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-15 19:16:15

问题


I am trying to use GSON in Android app but it causes a crash. After some reading it seems that HTC have included GSON and that causes a conflict. One propoused solution was to use jarjar.jar to rename gson classes to solve the conflict. When I try to do this I get this error:

Syntax error: Error on line 1: [{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360]

The command I am executing:

java -jar jarjar-1.2.jar process rules.txt gson-2.1.jar myjson-2.1.jar

rules.txt: rule com.google.gson.** com.google.myjson.@1

Any ideas?


回答1:


I had no problems using GSON, on any phone. Which problems are you facing?

Besides, it would seem that the rules.txt file you are passing is actually a RTF file. If you are using a Mac, try to save it again as a plain text file.



来源:https://stackoverflow.com/questions/10266143/gson-htc-desire-conflict-possible-solution-jarjar-jar-causes-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!