Android build fails (classnotfound)

I’m on Meteor 1.8, and Ubuntu 16.04. I’ve not built an app for android submission in a while, but as far as I know, neither my java, ubuntu, cordova nor meteor have been updated since the last build.

I’m getting an error when trying to run the app on android (or build for android release). The actual error message is totally useless:

FAILURE: Build failed with an exception.
* What went wrong:
sun/nio/fs/UnixFileAttributeViews$Basic

but after some manual debugging, I got the more helpful:

10:44:07.532 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] java.lang.NoClassDefFoundError: sun/nio/fs/UnixFileAttributeViews$Basic
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.nativeintegration.filesystem.jdk7.Jdk7FileMetadataAccessor.stat(Jdk7FileMetadataAccessor.java:39)
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.nativeintegration.filesystem.services.GenericFileSystem.stat(GenericFileSystem.java:82)
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:86)
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:72)
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:60)
10:44:07.533 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.groovy.scripts.internal.CrossBuildInMemoryCachingScriptClassCache.getOrCompile(CrossBuildInMemoryCachingScriptClassCache.java:46)

Why would this class be missing, and where can I get it from? The only thing I’ve changed recently is to add the inappbrowser cordova plugin - but I tried removing that (and resetting) and the error persists.

I dont know why this matters, but I switched from oracle-jdk to open-jdk, and now I’m good.

1 Like