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

java.lang.SecurityException: Invalid signature file digest for Manifest main attributes when upgrading to 3.0.0 + #325

Closed
Will5 opened this issue Jun 10, 2022 · 5 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists Platform: Android

Comments

@Will5
Copy link

Will5 commented Jun 10, 2022

Gradle Version

7.2.0

AGP Version

7.0.3

Code Minifier/Optimizer

No response

Version

3.1.0

Sentry SDK Version

5.7.0

Steps to Reproduce

I have some unit tests that pass with 3.0.0-beta.3, but fail with 3.0.0, 3.0.1 and 3.1.0. The issue appears to have to do with a change in the war the jar file is signed, though the security exception mentions something about manifest attributes.

Expected Result

BUILD SUCCESSFUL in 33s

Actual Result

BUILD FAILED in 13s

2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:316)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:258)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:321)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:234)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:767)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.util.jar.JarFile.ensureInitialization(JarFile.java:1050)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/jdk.internal.loader.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:872)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:786)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at org.robolectric.internal.bytecode.SandboxClassLoader.loadClass(SandboxClassLoader.java:128)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at java.base/java.lang.Class.getConstructors(Class.java:1943)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector.findConstructor(Injector.java:262)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector.inject(Injector.java:243)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector.lambda$new$0(Injector.java:126)
2022-06-10T17:29:18.175-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:498)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:224)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector.getInstance(Injector.java:208)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at org.robolectric.util.inject.Injector.getInstance(Injector.java:202)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at org.robolectric.internal.AndroidSandbox.lambda$new$0(AndroidSandbox.java:51)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2022-06-10T17:29:18.176-0400 [DEBUG] [TestEventLogger] at java.base/java.lang.Thread.run(Thread.java:829)

@Will5 Will5 added bug Something isn't working Platform: Android labels Jun 10, 2022
@romtsn
Copy link
Member

romtsn commented Jun 11, 2022

hey, sorry for the problems caused, we are aware of this issue (basically it's a dupe of #309).

We've decided not to fix it for now, because it was fixed in the Android Gradle plugin 7.1.2 and above. Would you be able to bump the AGP version? (Eventually we'll fix this, it's just not the highest priority)

@romtsn romtsn added duplicate This issue or pull request already exists and removed Status: Untriaged labels Jun 11, 2022
@marandaneto
Copy link
Contributor

@romtsn we could close it as dup then.

@romtsn romtsn closed this as completed Jun 11, 2022
@Will5
Copy link
Author

Will5 commented Jun 13, 2022

Thanks, I was looking to see if there was an open issue.

@Will5
Copy link
Author

Will5 commented Jun 13, 2022

So one problem we are running into with Android Gradle Plugin 7.1.0 and above is one of our native libraries is compiling for debug builds, but not for release builds. I'm trying to track this down, but I wonder if there is an ETA on a fix for this. Is it "eventually", or is it in the roadmap within some time frame? Thanks!

@romtsn
Copy link
Member

romtsn commented Jun 13, 2022

can't give an ETA, but if it's blocking you from using the plugin, we can raise the priority (cc @bruno-garcia)

btw, do you use auto-instrumentation? If not, you could disable it through tracingInstrumentation.enabled = false for now and the issue should go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists Platform: Android
Projects
Archived in project
Development

No branches or pull requests

3 participants