-
Notifications
You must be signed in to change notification settings - Fork 125
Proper documentation + Wiki #5
Comments
The .java files are generated by running the compiler. Once that's happened once, the errors should go away. |
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. |
@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. :) |
Much better now, I can step through and see the generated code now. |
I updated the README with:
There is also an entirely standalone sample project in https://github.com/Instagram/ig-json-parser/tree/master/maven-example |
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. |
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. |
@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. |
@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). |
@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. |
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. |
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. :) |
I'm going to close this issue because it's become a dumping ground for various issues. |
Opening a new "documentation + wiki" issue as #12 |
After going through the demo and unit test projects it took me almost 3 hours to realize how to make this to work. The current documentation only talks about annotating classes and misses consumption and generation of JSON. Proper documentation + Wiki is a must.
The text was updated successfully, but these errors were encountered: