Giter Club home page Giter Club logo

Comments (15)

jacobtabak avatar jacobtabak commented on June 3, 2024

Seconded,

red text

Is this normal? I realize the annotation processor is looking for that __JsonHelper suffix, but the fact that it shows up as a compiler error in the IDE is very confusing.

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

The .java files are generated by running the compiler. Once that's happened once, the errors should go away.

from ig-json-parser.

jacobtabak avatar jacobtabak commented on June 3, 2024

It's very strange... I've used a lot of annotation processing tools with generated classes and normally the errors do go away once the build succeeds. But in this case, I am able to run / debug and the symbols are never resolved. If I change the __JsonHelper to something else, then the build fails.

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

@jacobtabak I changed where the generated sources are placed in 0a822b3. you may need to reload the project, but I can now see the generated sources in android studio.

apologies; we don't use android studio/gradle internally, so there is a bit of a learning curve in getting things to play nicely with these tools. :)

from ig-json-parser.

jacobtabak avatar jacobtabak commented on June 3, 2024

Much better now, I can step through and see the generated code now.

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

I updated the README with:

  1. Information about how to include the library using Maven.
  2. An example of how to invoke the generated code.

There is also an entirely standalone sample project in https://github.com/Instagram/ig-json-parser/tree/master/maven-example

from ig-json-parser.

ignaciod avatar ignaciod commented on June 3, 2024

Sorry for my ignorance, but i don't use maven very often, so i'm unable to import any of the projects in this repository into eclipse. I've m2e plugin and can't get the project imported. What should i do? I'm very fond on using this Json parser library.

from ig-json-parser.

iNoles avatar iNoles commented on June 3, 2024

When I look at build.gradle, It is not setup to be android library at all. It expects you to build it for getting jar files.

from ig-json-parser.

TommyVisic avatar TommyVisic commented on June 3, 2024

@iNoles I was able to get it running by looking at the maven-example module that ttung mentioned above. As of right now, it looks like the JSON models need to be in their own module. That module's build.gradle file needs to look like the one in the readme. Your Android module then needs to declare it as a dependency (e.g. compile project(":app:igmodel") in its own build.gradle). It looks like the reason for this is the code generation is being kicked off with a method from the Java plugin, and this plugin isn't compatible with the Android plugin. I might be making that up though.

Also it looks like Android Studio needs to be building with at least Java 1.7 and not Java 1.6.

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

@ignaciod I recommend you just download the jars from https://oss.sonatype.org/content/repositories/releases/com/instagram/ig-json-parser-processor/0.0.3/ig-json-parser-processor-0.0.3.jar. You will have to enable the annotation processor for your project in Eclipse (you can probably just google for those directions).

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

@TommyVisic Conceptually, there is no reason why it shouldn't work w/ the android plugin. I'll need to investigate that though. Internally, we always keep the model classes in a separate package because the fields must be package-visible, and we don't want direct accesses.

from ig-json-parser.

TommyVisic avatar TommyVisic commented on June 3, 2024

That makes sense about the package-visible issue.

FYI, when attempting to apply both plugins, Gradle reports: Error:The 'java' plugin has been applied, but it is not compatible with the Android plugins.

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

Yeah, you can't apply both plugins. What I meant was: It might not be compatible at the moment, but I don't think it's fundamentally incompatible. :)

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

I'm going to close this issue because it's become a dumping ground for various issues.

from ig-json-parser.

ttung avatar ttung commented on June 3, 2024

Opening a new "documentation + wiki" issue as #12

from ig-json-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.