0

Every time i add compile com.googlecode.json-simple:json-simple:1.1.1 to use JSONParse and others, my app won't build or run and it shows these errors:

AGPBI:
{
   "kind": "error",
   "text": "Program type already present: org.hamcrest.BaseDescription",
   "sources": [
      {

      }
    ],
    "tool": "D8"
}

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\User\AndroidStudioProjects\MyPOS\app\build\intermediates\transforms\dexBuilder\debug\0.jar, C:\Users\User\AndroidStudioProjects\MyPOS\app\build\intermediates\transforms\dexBuilder\debug\1.jar

A bunch of those, but i edit it to be smaller. I don't know if it's the implementation itself, but all i know is that when i comment it, the error goes away But the thing is that i need it to use JSONParse and all that stuff. Thanks in advance

2
  • Hello, have you tried GSON ? :) It's much simpler to use. And that error, I think you will need Multidex, try to look it up! Best of luck :) Commented Oct 24, 2018 at 21:43
  • 1
    I'm gonna give it a try, Thanks a lot! Commented Oct 24, 2018 at 21:47

1 Answer 1

1

As for your error, I suggest using Multidex, since you are over your 65k method limit.

To read more about it, try this link: http://www.androiddocs.com/tools/building/multidex.html

Also, I would suggest using GSON library over that one since it's more widely used. (Personal preference too)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.