GSON + HTC Desire的:冲突。可能的解决方法jarjar.jar导致错误 [英] GSON + HTC Desire: Conflict. Possible solution jarjar.jar causes error
问题描述
我想在Android应用程序使用GSON但它会导致崩溃。一些看完之后似乎HTC包括GSON并导致冲突。一propoused解决方案是使用jarjar.jar重命名GSON类来解决冲突。当我尝试这样做,我得到这个错误:
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:
语法错误:错误在第1行:[{\\ RTF1 \\ ANSI \\ ansicpg1252 \\ cocoartf1038 \\ cocoasubrtf360]
Syntax error: Error on line 1: [{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360]
我执行命令:
Java的罐子jarjar-1.2.jar过程rules.txt GSON-2.1.jar myjson-2.1.jar
java -jar jarjar-1.2.jar process rules.txt gson-2.1.jar myjson-2.1.jar
rules.txt:
治com.google.gson ** com.google.myjson。@ 1
rules.txt: rule com.google.gson.** com.google.myjson.@1
任何想法?
推荐答案
我使用GSON,任何手机上没有任何问题。哪些问题是你面对?
I had no problems using GSON, on any phone. Which problems are you facing?
此外,它似乎要传递的rules.txt文件实际上是一个RTF文件。如果您使用的是Mac,请尝试重新保存为纯文本文件。
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.
这篇关于GSON + HTC Desire的:冲突。可能的解决方法jarjar.jar导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!