1

I want to convert a Json String to an object, without out a library. The reason is that I want to convert the Java code with J2Objc into a Objective-C file. And J2Objc doesn't allow libraries as far as I know. Does anyone know an answer to this question?

Thank you!

1 Answer 1

1

J2Objc does actually support libraries, as explained in the docs. The are plugins available for eclipse, maven and gradle that handle everything for you.

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

5 Comments

Okay, thanks. But when I add the library as an internal, I get "The import com.google.gson.Gson cannot be resolved".
What build system are you using? What is your full build-script/file whatever?
I am using MacOS and try to transalte it with the terminal, not the eclipse plugin. And my file is just a normal Java file with an gson implementation. I have tried to put it in the lib directory and then I tried to put it on the same level as the Java file.
I really recommend you to switch to a real build system eg. gradle, it will make your life a lot easier. I don't know how to get J2Objc to translate the libraries using the command line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.