Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 #1524

Open
znakeeye opened this issue Jun 15, 2021 · 3 comments

Comments

@znakeeye
Copy link

Running android-arscblamer I got this error for my APK:

INFO: Build completed successfully, 22 total actions
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$2 (file:/C:/Users/foo/_bazel_foo/sajszmsi/external/guice/jar/guice-4.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NullPointerException
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:890)
        at com.google.devrel.gmscore.tools.apk.arsc.PackageChunk.getTypeSpecChunk(PackageChunk.java:202)
        at com.google.devrel.gmscore.tools.apk.arsc.ResourceEntryStatsCollector.computeTypeSpecSizes(ResourceEntryStatsCollector.java:175)
        at com.google.devrel.gmscore.tools.apk.arsc.ResourceEntryStatsCollector.computeTypeSpecSizes(ResourceEntryStatsCollector.java:117)
        at com.google.devrel.gmscore.tools.apk.arsc.ResourceEntryStatsCollector.computePackageSizes(ResourceEntryStatsCollector.java:95)
        at com.google.devrel.gmscore.tools.apk.arsc.ResourceEntryStatsCollector.compute(ResourceEntryStatsCollector.java:73)
        at com.google.devrel.gmscore.tools.apk.arsc.ArscDumper.dumpEntries(ArscDumper.java:209)
        at com.google.devrel.gmscore.tools.apk.arsc.ArscDumper.dumpEntries(ArscDumper.java:194)
        at com.google.devrel.gmscore.tools.apk.arsc.ArscDumper.main(ArscDumper.java:115)

This APK was minified with android.enableR8.fullMode=true if that matters.

@mcculls
Copy link
Contributor

mcculls commented Jun 15, 2021

Have you tried the latest 5.0.1 release of Guice? It doesn't use CGLIB and won't produce this message.

@znakeeye
Copy link
Author

Changed the version to 5.0.1 in my WORKSPACE and those warnings did disappear. The exception still occurs though.

maven_jar(
    name = "guice",
    artifact = "com.google.inject:guice:5.0.1",
)

@mcculls
Copy link
Contributor

mcculls commented Jun 16, 2021

The NullPointerException is coming from android-arscblamer code, specifically https://github.com/google/android-arscblamer/blob/master/java/com/google/devrel/gmscore/tools/apk/arsc/PackageChunk.java#L202 - it doesn't appear to be related to any injection performed by Guice.

I'd suggest contacting the android-arscblamer project to find out why the typeSpecs chunk is null for that id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants