Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tyler Davis
    @davityle
    Feel free to ask any questions or discuss anything here.
    Matthew Butlar
    @mattbutlar
    Hey man, loving the project so far and putting it to use but looks like with the new annotation stuff we are running into some issues. As soon as the annotation processor is brought in to our project it fails to run because it same it can't find our custom application so I am assuming the annotation processor can't find the AndroidManifest. I'm going to keep looking into it but just wanted to give you a heads up.
    Tyler Davis
    @davityle
    I'm guessing you are running on Windows? I just booted up my windows virtual machine two days ago and fixed that problem (If it is the same problem). I'll push up the changes asap and let you know.
    Tyler Davis
    @davityle
    Try using
    compile 'com.github.davityle:ngandroid:1.0.5-SNAPSHOT'
    apt 'com.github.davityle:ng-processor:1.0.5-SNAPSHOT'
    see if that fixes your problem
    Matthew Butlar
    @mattbutlar
    I am on windows 8.1... and unfortunately that didn't fix it
    Matthew Butlar
    @mattbutlar
    I'm still not sure why it is crashing but it def is only crashing when pulling using apt 'com.github.davityle:ng-processor:1.0.5-SNAPSHOT'
    if I remove that it will fire up fine and only crash when I try to go into a view using ngAndroid
    Matthew Butlar
    @mattbutlar
    I'm going to try building it on my linux machine to rule out windows issues, I will let you know the outcome
    Matthew Butlar
    @mattbutlar
    Ok, I built it on my linux machine and got the same result... so its just something about either the ngandroid annotation processor or the android-apt in general
    Tyler Davis
    @davityle
    What is the error that you are getting?
    the apt 'com.github.davityle:ng-processor:1.0.5-SNAPSHOT' is required for the library to work because it compiles the scope, model, and scripts. The library will not be able to find the compiled code without it
    After the build fails if you scroll down in the 'messages' box than it will tell you why it failed.
    Tyler Davis
    @davityle
    it could be something about about your model. The annotation processing is stricter about certain things than the reflection version was, and less strict about others.
    Matthew Butlar
    @mattbutlar
    hahaha yeah I know, I do android dev for a living... it's saying it can't find our custom application
    in our android manifest we have our application's application name set and it's saying it can't find it in the dex file to start it... and if I were to remove the name so it defaults to the regular android application then it fails to find the first activity, same error, different item
    Matthew Butlar
    @mattbutlar
    in case it's any help this is the error "java.lang.RuntimeException: Unable to instantiate application com.package.name.applicationName: java.lang.ClassNotFoundException: Didn't find class "com.package.name.applicationName" on path"
    Tyler Davis
    @davityle
    What's the exact compile time error?
    Matthew Butlar
    @mattbutlar
    there is no compile time error... only runtime... and it's what I posted... and that runtime error only happens when the processor is in the build
    so it must be changing something during the build or possibly there is some kind of conflicting dependency... offhand I would assume maybe it plus multidex... I will prob just sit down and read through the processor to see whats going on and go from there
    Tyler Davis
    @davityle
    alright. So I made the compiler more descriptive about it's failure, It'll also always build each scope so if something does not map properly and the compiler misses it (I'll be working on making sure this doesn't happen) than the error you get at runtime will also be more descriptive. Try these
     compile 'com.github.davityle:ngandroid:1.0.6-SNAPSHOT'
     apt 'com.github.davityle:ng-processor:1.0.6-SNAPSHOT'
    Matthew Butlar
    @mattbutlar
    Just tried it, same error, no more info... its not ngandroid crashing but something with it is making changes that are causing the app to crash... or there is a conflict of some sort... I've been too busy to look into it with more depth but I will try to
    Matthew Butlar
    @mattbutlar
    Hey I'm still fiddling around with the annotation version of ngAndroid in my spare time and haven't resolved it yet but in the previous version we are seeing something that may be a bug and I wanted to see if we are just doing something weird or if it is actually a bug. We are using ngAndroid pretty heavily in on of our Activitys. It plus the child fragments and all the views are using it. So what we are seeing is we have listview items using ngAndroid and if we change the adapter to have less items the old views are kind of staying alive and it looks like its because of ngAndroid holding a reference to them
    Matthew Butlar
    @mattbutlar
    nevermind I think it may just be listview recycling causing it
    Matthew Butlar
    @mattbutlar
    OK so I started diving into our issues with the annotation build... For whatever reason it is trying to find the application and activity classes in base.all of a folder ending with a -2 which is odd since that doesn't exist on the phone... So no idea yet why it would want to look there and only when the annotations are enabled
    Matthew Butlar
    @mattbutlar
    ok, so an even deeper dive and I found it was getting the wrong dir but now its looking good so it must have been a fluke but opening the apk and looking for the application where it should be, its not there... in a build without annotations it is in there
    Matthew Butlar
    @mattbutlar
    So looks like I may have gotten everything fixed... so I setup a remote debug setup to debug the annotation processor as it built but it seemed to have some conflicts with some other annotation based dependencies we had so I stripped out everything we didnt need and got the compile debug running and finally started hitting breakpoints in the processor and started getting actual compile errors... some are models needing to be public... so I'm going through everything now and fingers crossed it will work when I'm done... just so you know though, the errors do not spit out if I build via the play button, it will build and push to the device then break... if I build via the terminal then I get the errors, so it might be something to look into for the future so it will be easier to see the issues if you arent building via the command line
    thank you again for your help too
    Matthew Butlar
    @mattbutlar
    Also not sure if you meant it this way but in ElementUtils you are matching an unchanged string against a string that was made lowercase which means that both the view and model fields need to be lowercase or it errs out... I imagine you either wanted both to be changed to lowercase or neither to be
    Matthew Butlar
    @mattbutlar
    I actually just put up a pull request to fix those issues as it is a big pain point for us to go through and make all our model variables lowercase... if you could pull it in if you approve and get it up on maven it would be hugely appreciated... save us from having to make a local build
    Tyler Davis
    @davityle
      compile 'com.github.davityle:ngandroid:1.0.7-SNAPSHOT'
       apt 'com.github.davityle:ng-processor:1.0.7-SNAPSHOT'
    you should be good to go with those. I didn't have time to test it thoroughly or merge your changes. Let me know if you have any issues. thanks for contributing
    Matthew Butlar
    @mattbutlar
    it says it can't find 1.0.7... possibly didnt push it up to maven?
    Matthew Butlar
    @mattbutlar
    looks like 1.0.7 of processor is there but not ngandroid... also I noticed that setcontentview is taking in a Scope as the scope instead of Object which all the others take in... I'm guessing thats not intentional, I can make a pull request for that change if you like
    Matthew Butlar
    @mattbutlar
    nevermind it actually just needs a separate setcontentview that allows a separate scope from activity... I didnt read the code when I first saw the error
    Matthew Butlar
    @mattbutlar
    added set content with the separate scope to the pull request incase you want to add it, right now I'm just using it locally
    Tyler Davis
    @davityle
    okay, i merged and pushed those changes up into 1.0.8
    Matthew Butlar
    @mattbutlar
    Awesome! I noticed an issue and there has to be a conflict or something going on... so whenever we try to run the processor from maven it doesn't work at all but if I put it in our project as a local project then it has an error in TypeUtils.java saying that 3 of the functions being overridden don't match the parent and if I remove the overrides then it builds and everything works great so I am wondering if it's related to the failures when we pull from maven... possibly it is pulling the wrong version of some dependency?
    based on what I am seeing it looks like fields that belong to Element are being overridden in a TypeMirror... so it obviously complains since those functions dont exist in TypeMirror
    private static final TypeMirror STRING = new TypeMirror() {
    @Override public TypeKind getKind() {return null;}
    @Override public <R, P> R accept(TypeVisitor<R, P> v, P p) {return null;}
    public List<? extends AnnotationMirror> getAnnotationMirrors() {return null;}
    public <A extends Annotation> A getAnnotation(Class<A> annotationType) {return null;}
    public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {return null;}
            @Override
            public String toString() {
            return String.class.getName();
        }
    };
    Matthew Butlar
    @mattbutlar
    well thats pasted weird but thats the code... those 3 public functions are the ones we had to remove override on since they dont exist in TypeMirror
    Tyler Davis
    @davityle
    hmm, that's interesting. I'm running on Java 8. I wonder if that has something to do with it.
    I'll remove those @Override annotations
    Matthew Butlar
    @mattbutlar
    Yeah we are using ngandroid as our MVC solution from here forward so we are vetting out a lot of issues as we go ha...
    Tyler Davis
    @davityle
    well I'll do me best to release often and get an official release of the annotation processor soon
    Tyler Davis
    @davityle
    hey. I just updated the source compatibility and removed those override annotations. I pushed another build up to 1.0.9 if you want to try that out
    Matthew Butlar
    @mattbutlar
    I noticed an issue that seems to come up any time I am using ngandroid that may be worth looking into... I made a custom view that loads some drawables into variables on creation so they can be used later but when I use that custom view in something inflated by ngandroid it fails to inflate when it tries to do getResources().getDrawable() looks like its trying to map it to values even though its not using ngandroid
    Matthew Butlar
    @mattbutlar
    Its related to an error the drawable is having because of mapping an animated-selector to a drawable but it has no prob doing it as long as its not in the inflate with ngandroid so it may be a fluke or an edge case... I'll let you know what I find
    Matthew Butlar
    @mattbutlar
    yeah its looking like that issue left when we switched to annotations and this is a separate issue in the same spot not related to ngandroid
    Tyler Davis
    @davityle
    that makes sense, with the annotations ngAndroid leaves the inflating completely up to the inflater and binds after the inflation, but the old reflection based code inserted a custom factory. Let me know if you find any other issues