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

Class module-info is missing a super type #302

Closed
generosocarbone opened this issue Aug 11, 2018 · 6 comments
Closed

Class module-info is missing a super type #302

generosocarbone opened this issue Aug 11, 2018 · 6 comments
Labels

Comments

@generosocarbone
Copy link

  • OS and version used: Android (min api 23)

  • Java runtime used: 1.8.0_152-release

  • SDK version used: 1.13.2

Description of the issue:

I am trying to build an android application and I get a compilation error due to an API version constraint.

Console log of the issue:

AGPBI: {"kind":"error","text":"Illegal class file: Class module-info is missing a super type.","sources":[{"file":"/home/generoso/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.11.0/bede79a3f150711634a3047985517431bf6499f2/log4j-api-2.11.0.jar"}],"tool":"D8"}

AGPBI: {"kind":"error","text":"MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"} com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /home/generoso/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.11.0/bede79a3f150711634a3047985517431bf6499f2/log4j-api-2.11.0.jar

Now, my problem is that I'm bound to the API version 23/24/25 and I need the fix for the SocketTimeoutException

@JMayrbaeurl
Copy link
Contributor

That's coming from the missing full support for Java 8 language features in Android. For details see https://developer.android.com/studio/write/java8-support . Especially MethodHandle.invoke needs Android's min sdk API version 26 to work correctly. Obvisouly log4j v2 uses this method if you're running it on a Java 8 VM. In my opinion this is really tricky, because as soon as library like log4j recognizes it's running on Java 8, it will use existing Java 8 features like the MethodHandle class.

@generosocarbone
Copy link
Author

[Update] just for a matter of completeness, I updated my min api to 26, but still the
"Illegal class file: Class module-info is missing a super type." issue persist.
I tried compiling with both Java 8 and 9.

Environment:
Java runtime used: openjdk version "9.0.4"
OpenJDK Runtime Environment (build 9.0.4+11)
OpenJDK 64-Bit Server VM (build 9.0.4+11, mixed mode)

Java runtime used: openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
OpenJDK 64-Bit Server VM (build 25.152-b01, mixed mode

Android Studio 3.1.4
Build #AI-173.4907809, built on July 23, 2018
JRE: 1.8.0_152-release-1024-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.0-46-generic

module-info-missing-supertype.txt

@jasmineymlo
Copy link
Contributor

@generosocarbone, we have recently catch up on supporting Android. If you are still having the above issue, checkout our our updated sample which minSdkVersion 23. Our quickstart guide for your reference. Feel free to let us know if you have any issue.

@generosocarbone
Copy link
Author

@jasmineymlo the issue is gone since one of the last updates, I don't remember which.

@jasmineymlo
Copy link
Contributor

Good to know. Thanks

@az-iot-builder-01
Copy link
Collaborator

@JMayrbaeurl, @generosocarbone, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

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

No branches or pull requests

5 participants