-
Notifications
You must be signed in to change notification settings - Fork 63
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
Android compile error #16
Comments
The module-info is used only with Java 9 and up for the new "Jigsaw" module feature added with Java 9: I added that file only for those who wished to use Java 9 modules. Using modules is somewhat optional (you can choose to put everything in the default module). AFAIK Android does not yet support Java 9, but does support most, if not all, of Java 8. Certainly, it sounds like your android version does not support Java 9 modules. So you can just delete that source file module-info.java, and you can delete the compiled file module-info.class, it doesn't need to be there when not using modules. |
Perhaps I will add another jar file that does not have module-info inside. In reality the file should be ignored when not using modules but I guess your android environment is not ignoring it. You can just use any zip-file tool (winzip, gzip, winrar, zip, etc) to remove the module-info class file from your jar file (a jar file is actually a zip file). |
I see. Thanks for the info.
I'm using gradle for dependencies and it pulls everything from mavenCentral
so I think there is no permenant way for me to remove that file without
having a local repo.
So if it's not too much of hassle I would be grateful if you could have
another jar like you mentioned.
BTW I'm using react native and its build environment. It's likely that
people using react native will get the exact same error.
Thanks
…On Tue, 8 Jan 2019, 22:44 Sean C Foley ***@***.*** wrote:
Perhaps I will add another jar file that does not have module-info inside.
In reality the file should be ignored when not using modules but I guess
your android environment is not ignoring it. You can just use any zip-file
tool (winzip, gzip, winrar, zip, etc) to remove the module-info class file
from your jar file (a jar file is actually a zip file).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANq8Jd3voB35SrNJXaSTXxuBz2NQh-uks5vBPUGgaJpZM4Z2Hji>
.
|
OK, seems you are not the first to encounter this. Not sure if anyone found a nice solution in any of those other issues. I'll have to give this a little thought. |
@tapir Strangely, there appear to be no simple solution from any of Maven, Android Studio, Java, or Gradle, although eventually Android Studio will likely have some kind of fix. From what I can tell, what others have done:
Not sure if you would need "module-info" or "module-info.class" There is a complete example build file here: https://github.com/shevek/jarjar/blob/master/jarjar-gradle/example/build.gradle |
looks like a good solution to me. thanks |
@tapir Have you tried it? If and when you try it, can you let me know if it works? |
Sorry it took a while. Most of the time I've spent went to solve how to apply gradle plugins. TL,DR: It works. |
@tapir Great! Good to know it works. Also, keep in mind Android Studio will almost certainly have its own fix eventually. |
This appears to have been fixed in Android Studio 3.3
|
Although I can work with ipaddress outside of an android project, when I'm trying in one I get this error
ipaddress-5.0.1.jar: D8: Illegal class file: Class module-info is missing a super type.
Any ideas?
The text was updated successfully, but these errors were encountered: