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

failed to process jar: Bad class file #70

Closed
yschimke opened this issue Oct 2, 2019 · 3 comments · Fixed by square/okhttp#6300
Closed

failed to process jar: Bad class file #70

yschimke opened this issue Oct 2, 2019 · 3 comments · Fixed by square/okhttp#6300

Comments

@yschimke
Copy link
Contributor

yschimke commented Oct 2, 2019

Seen on this PR

square/okhttp#5525

$ ./gradlew :okhttp:animalsnifferMain --stacktrace
...
Caused by: java.io.IOException:  failed to process jar /Users/yuri/.gradle/caches/modules-2/files-2.1/org.robolectric/android-all/Q-robolectric-5415296/675f28b006b4836563afee8d2f8468fece4d5bd7/android-all-Q-robolectric-5415296.jar : Bad class file /Users/yuri/.gradle/caches/modules-2/files-2.1/org.robolectric/android-all/Q-robolectric-5415296/675f28b006b4836563afee8d2f8468fece4d5bd7/android-all-Q-robolectric-5415296.jar:libcore/io/Os.class
	at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processJarFile(ClassFileVisitor.java:185)
	at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.process(ClassFileVisitor.java:120)
	at org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask.apply(CheckSignatureTask.java:272)
	at org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask.buildPackageList(CheckSignatureTask.java:246)
	at org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask.execute(CheckSignatureTask.java:166)
	... 119 more
Caused by: java.io.IOException: Bad class file /Users/yuri/.gradle/caches/modules-2/files-2.1/org.robolectric/android-all/Q-robolectric-5415296/675f28b006b4836563afee8d2f8468fece4d5bd7/android-all-Q-robolectric-5415296.jar:libcore/io/Os.class
	at org.codehaus.mojo.animal_sniffer.ClassListBuilder.process(ClassListBuilder.java:91)
	at org.codehaus.mojo.animal_sniffer.ClassFileVisitor.processJarFile(ClassFileVisitor.java:175)
	... 123 more
Caused by: java.lang.IllegalArgumentException
	at org.codehaus.mojo.animal_sniffer.asm.shaded.ClassReader.<init>(Unknown Source)
	at org.codehaus.mojo.animal_sniffer.asm.shaded.ClassReader.<init>(Unknown Source)
	at org.codehaus.mojo.animal_sniffer.asm.shaded.ClassReader.<init>(Unknown Source)
	at org.codehaus.mojo.animal_sniffer.ClassListBuilder.process(ClassListBuilder.java:69)
	... 124 more
@yschimke
Copy link
Contributor Author

yschimke commented Oct 2, 2019

Happened after upgrading the robolectric jar from Android P to Q. But seems like an issue to report here.

@yschimke
Copy link
Contributor Author

yschimke commented Oct 2, 2019

Happens with 1.17 and 1.18

@yschimke
Copy link
Contributor Author

yschimke commented Oct 2, 2020

This seems fixed in latest version.

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

Successfully merging a pull request may close this issue.

1 participant