java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class at the start of android app

。_饼干妹妹 提交于 2019-12-03 23:20:38

In android studio, I changed build.gradle dependencies.

dependencies {
    ...
    compile 'com.google.inject:guice:4.0-beta:no_aop'
    compile 'org.roboguice:roboguice:2.0'
}
Roberto Andrade

This seems to be an issue with guide 3.0 no_aop. I upgraded to guice 4.0 (beta) no_aop and the issue went away.

<dependency>
  <groupId>com.google.inject</groupId>
  <artifactId>guice</artifactId>
  <version>4.0-beta</version>
  <classifier>no_aop</classifier>
</dependency>

you'll also need to add an exclusion to the original roboguice dependency:

<dependency>
    <groupId>org.roboguice</groupId>
    <artifactId>roboguice</artifactId>
    <version>2.0</version>
    <scope>compile</scope>
    <exclusions>
        <exclusion>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </exclusion>
    </exclusions>
</dependency>

According to this issue, the problem is a superficial one. It offers several circularly referenced rabbit holes to explain it, I gave up after the first few. The gist of it is that it can't be garbage collected properly and that if you are "doing funky classloader stuff" you may run into problems.

For me, upgrading to guice 4.0-beta introduced an error regarding com.google.inject.utils.$ImmutableList, which is more problematic than the (apparently) superficial Finalizer issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!