Nativescript: New & existing apps in 2.0 on Android fails to build

Created on 27 Apr 2016  路  8Comments  路  Source: NativeScript/NativeScript

Did you verify this is a real problem by searching

Yes

Tell us about the problem

Unable to build project

Will produce:
:asbg:generateInterfaceNamesList
java.lang.UnsupportedClassVersionError: com/ig/GetInterfaceNames : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Exception in thread "main" :asbg:generateInterfaceNamesList FAILED

FAILURE: Build failed with an exception.

  • Where:
    Build file 'D:\projects\nativescript\test2\platforms\android\build-tools\android-static-binding-generator\build.gradle' line: 30
  • What went wrong:
    Execution failed for task ':asbg:generateInterfaceNamesList'.

Process 'command 'C:\Program Files\Java\jdk1.7.0_21\bin\java.exe'' finished with non-zero exit value 1

Which platform(s) does your issue occur on?

Android on Windows

Please provide the following version numbers that your issue occurs with:

TNS info says everything is 2.0.0

Please tell us how to recreate the issue in as much detail as possible.

tns create test
cd test
tns platform add android
tns run android --emulator

Most helpful comment

Doc should report this if possible +1

All 8 comments

It looks you have Java 1.7.
{N} now require Java 1.8, see https://github.com/NativeScript/nativescript-cli#system-requirements

Ah, TNS doctor does not report any issues!

Doc should report this if possible +1

Please note I upgraded to v1.8 - And this actually does fix the primary issue. Yeah!

HOWEVER,

  1. On 1.7, TNS Doctor as reported above said everything was good.
    2 On 1.8, TNS doctor now says I have issues with my ANDROID_HOME & android.bat file, even though I can run android.bat fine and I can now build perfectly fine.

Someone needs to go back to medschool... Looking at you doc

I don't have those issues on my Win10 PC @NathanaelA w/ _1.8_, I get:

Your components are up-to-date. No issues were detected.

No major issues now that I have Java 1.8 and running NS 2.0 on new apps. One minor issue about _AppBuilderCallback_ (WTF - but it happened with 1.7.1 and has come up on Slack in recent weeks), and a good ole platform remove/add fix it every time.

This issue was moved to NativeScript/nativescript-cli#1729

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings