Coder Social home page Coder Social logo

Comments (23)

ubuntudroid avatar ubuntudroid commented on May 5, 2024

Yeah, that would be much appreciated - one example of a popular library using this class name scheme during automatic code generation is Dagger which is indeed widely used. Can't use infer until this issue is solved. 😿

from infer.

theblang avatar theblang commented on May 5, 2024

+1

Exact same problem here. The Infer output says you can add abortOnError false to lintOptions, but I would rather this just not cause an error in the first place.

@zsiegel Which library is doing it for you? I personally am not using Dagger, but perhaps Butterknife?

from infer.

zsiegel avatar zsiegel commented on May 5, 2024

from infer.

sblackshear avatar sblackshear commented on May 5, 2024

Thanks for the report! This is due to a problem in the javalib library we use to parse Java bytecode. We are working on getting it fixed upstream.

from infer.

seanabraham avatar seanabraham commented on May 5, 2024

+1, looking forward to the fix for this!

from infer.

winterDroid avatar winterDroid commented on May 5, 2024

+1

from infer.

 avatar commented on May 5, 2024

+1

from infer.

VoidBreakTek avatar VoidBreakTek commented on May 5, 2024

+1 for Butterknife, would also love to use Dagger and I believe the Dagger2 generated classes have similar naming to Butterknife so potentially same issue here. Possibly a way to exclude generated classes?

from infer.

jeremydubreil avatar jeremydubreil commented on May 5, 2024

Yes, we will just skip the classes with the name containing $$ for now, while we are trying to fix the library used to parse the bytecode.

from infer.

Folyd avatar Folyd commented on May 5, 2024

I met the same problem when i used ButterKnife library in my project. Look forward the new feature!:)

from infer.

oshamahue avatar oshamahue commented on May 5, 2024

Here is my log.

Fatal error: exception Invalid_argument("Error : com.packagename.HomeActivity$$InjectAdapter is not a valid name for a class")
[ERROR] Failure during frontend, original command was
[u'inferJ', u'-g', u'-a', 'capture', u'javac', '-source', '1.7', '-target', '1.7', '-d'{bunch project jars}]


Traceback (most recent call last):
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/infer", line 142, in <module>
    main()
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/infer", line 119, in main
    capture_exitcode = imported_module.gen_instance(args, cmd).capture()
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/gradle.py", line 42, in capture
    return util.run_commands(cmds)
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
    if not cmd.start():
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 632, in start
    if self.capture() == os.EX_OK:
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 400, in capture
    return self.run_infer_frontend()
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
    self.args.analyzer
  File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
    raise e
subprocess.CalledProcessError: Command '[u'/Library/infer-osx-v0.1.0/infer/infer/bin/InferJava', u'-results_dir', u'/Users/user/GitHub/Android-app/infer-out', u'-verbose_out', '/var/folders/68/4pkjv9fd743040h3dmj98kbm0000gn/T/javac_KjBTQT.out', u'-models', u'/Library/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2

from infer.

jeremydubreil avatar jeremydubreil commented on May 5, 2024

@oshamahue: did you use the Infer binaries or did you compiled Infer from sources ?

from infer.

oshamahue avatar oshamahue commented on May 5, 2024

@jeremydubreil I used the binaries. I added infer-osx-v0.1.0/infer/infer/bin as a path and used it from there.

from infer.

richterrene avatar richterrene commented on May 5, 2024

+1 ... a fix for Butterknife (and Dagger, if there's a problem as well) would be highly appreciated 💃 :)

from infer.

sblackshear avatar sblackshear commented on May 5, 2024

This issue has been sidestepped by 4526ada, which stops Infer from crashing when it encounters $$ classnames (though it won't analyze these classes; we are working on that). However, you have to build Infer from source for this to work; we haven't released new binaries with the fix yet.

from infer.

Macarse avatar Macarse commented on May 5, 2024

@sblackshear can you release a new version with this fix? Do you have planned release schedules?

from infer.

dulmarod avatar dulmarod commented on May 5, 2024

Hi,
we made a new release today that contains the fix. You could try it out. We are planning to do releases regularly.

from infer.

dmorehouse avatar dmorehouse commented on May 5, 2024

Any idea when the upstream fix in javelib will get done? For those of us using Dagger, not analyzing the Dagger injected classes basically means that very little in our Android projects get analyzed. All our "services" / "business logic" classes are injected.

from infer.

plowman avatar plowman commented on May 5, 2024

Hey @dmorehouse,
As dulmarod mentioned above, they pushed a new build which fixes this issue. Download the latest binaries and try again.

from infer.

theblang avatar theblang commented on May 5, 2024

@plowman The fix right now is just sidestepping the $$ classes and not analyzing them.

from infer.

jvillard avatar jvillard commented on May 5, 2024

This problem should be fixed soon and will likely make it to the next release of Infer in the next few days. Stay tuned!

from infer.

plowman avatar plowman commented on May 5, 2024

Aha, that makes more sense. Thanks @mattblang.

from infer.

jvillard avatar jvillard commented on May 5, 2024

This has been fixed in the latest release.

from infer.

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.