Trying to Build SDK

Hi team,

I am trying to build the sdk and get this error on the gradlew build task.

Any ideas or help?

To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.11/userguide/gradle_
emon.html.
Full Version: 3.1-stable-FINAL
POM Version: 3.1.0-stable-FINAL
NBM Revision: 1700
NBM UC Suffix: stable/3.1/plugins

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\workspaces\privatework\gitprojects\sdk\build.gradle' line: 334

* What went wrong:
A problem occurred evaluating root project 'sdk'.
> Could not resolve all dependencies for configuration ':optlibs'.
   > Could not find org.jmonkeyengine:jme3-jbullet:3.1.0-stable.
     Searched in the following locations:
         file:/C:/Users/Nidebruyn/.m2/repository/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.pom
         file:/C:/Users/Nidebruyn/.m2/repository/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.jar
         http://jcenter.bintray.com/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.pom
         http://jcenter.bintray.com/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.jar
         http://updates.jmonkeyengine.org/maven/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.pom
         http://updates.jmonkeyengine.org/maven/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.jar
         http://nifty-gui.sourceforge.net/nifty-maven-repo/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.pom
         http://nifty-gui.sourceforge.net/nifty-maven-repo/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.jar
         https://jitpack.io/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.pom
         https://jitpack.io/org/jmonkeyengine/jme3-jbullet/3.1.0-stable/jme3-jbullet-3.1.0-stable.jar
     Required by:
         :sdk:unspecified
   > Could not find org.jmonkeyengine:jme3-ios:3.1.0-stable.
     Searched in the following locations:
         file:/C:/Users/Nidebruyn/.m2/repository/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.pom
         file:/C:/Users/Nidebruyn/.m2/repository/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.jar
         http://jcenter.bintray.com/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.pom
         http://jcenter.bintray.com/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.jar
         http://updates.jmonkeyengine.org/maven/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.pom
         http://updates.jmonkeyengine.org/maven/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.jar
         http://nifty-gui.sourceforge.net/nifty-maven-repo/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.pom
         http://nifty-gui.sourceforge.net/nifty-maven-repo/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.jar
         https://jitpack.io/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.pom
         https://jitpack.io/org/jmonkeyengine/jme3-ios/3.1.0-stable/jme3-ios-3.1.0-stable.jar
     Required by:
         :sdk:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.305 secs

Have you built the engine locally by invoking gradlew install on it?

Can you please explain a little bit more?

This is what I did:

  1. cloned the sdk repo
  2. cd to the sdk directory
  3. ran gradlew build

That is all.

Ah okay, then that’s the fault.
The engine does not distribute every dependency as a jar anymore (due to maven central policies and such), but the SDK needs them.

So you have to call build_engine.sh in your git shell or manually downloading the engine and run gradlew install on the engine source code, so it is built and placed in your “local maven server” (The .m2 directory)

Keep an eye on the engine version though, e.g. when you don’t checkout the v3.1.0-stable tag, you might need to change the used engine version in the sdk’s build.gradle, but you will quickly notice that :slight_smile:

Edit: If step 2 (cd to the sdk directory) means that you opened cmd in the sdk directory then it’s fine. Just note that if you have some code with an actual sdk folder, it’s 3.1-alpha1 or older.

Okay thanks @Darkchaos,

The reason I am doing this is that I have found a bug with the sdk build on netbeans 8.2

For some reason there is something wrong with the NBAndroid plugin.

So if you create a jME app in SDK with the stable release and try to build a signed apk for android I get the following:
Oh and also found this on the web:

Creating BasicGame31-release-unsigned.apk for release...
Signing final apk...
C:\workspaces\privatework\gitprojects\bruynhuis\BasicGame31\nbproject\mobile-impl.xml:21: The following error occurred while executing this line:
C:\android-sdk\tools\ant\build.xml:1135: The following error occurred while executing this line:
C:\android-sdk\tools\ant\build.xml:1147: 
java.lang.InternalError: Could not obtain X500Principal access
	at sun.security.x509.X500Name.<clinit>(X500Name.java:1399)
	at com.android.sdklib.internal.build.SignedJarBuilder.writeSignatureBlock(SignedJarBuilder.java:384)
	at com.android.sdklib.internal.build.SignedJarBuilder.close(SignedJarBuilder.java:273)
	at com.android.ant.SignApkTask.createOutput(SignApkTask.java:78)
	at com.android.ant.SingleInputOutputTask.execute(SingleInputOutputTask.java:66)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
	at com.android.ant.IfElseTask.execute(IfElseTask.java:124)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: javax.security.auth.x500.X500Principal.<init>(sun.security.x509.X500Name)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.security.x509.X500Name.<clinit>(X500Name.java:1392)
	... 60 more
Caused by: java.lang.NoSuchMethodException: javax.security.auth.x500.X500Principal.<init>(sun.security.x509.X500Name)
	at java.lang.Class.getConstructor0(Class.java:3082)
	at java.lang.Class.getDeclaredConstructor(Class.java:2178)
	at sun.security.x509.X500Name$1.run(X500Name.java:1384)
	at sun.security.x509.X500Name$1.run(X500Name.java:1380)
	... 62 more

Okay, that is definately a problem for us then.
I wonder if it makes a difference depending on which java/jdk you use?
Since NoSuchMethodException for sun and or javax classes tend to be related to missing jars.

I don’t remember if the sdk installer comes with a stripped down version of the jdk or if that was only the jre of my private project. If it works when you build it locally, then it would definately could be related to the jdk we are packaging.

I did try to change to a different jdk also tried older jdk’s but did not work.
There was no problem with this before we changed to netbeans8.2

O and I also played around with the compiler level. nothings seems to work.

@Darkchaos, let me try and build a local version of the sdk with netbeans8.1 and see if that solves the problem.

Thanks

1 Like

@Darkchaos, I am still struggling to make a sdk build locally.
I am trying to make a buildSdk on the sdk code for branch 3.1 but I get the following error:

C:\workspaces\privatework\gitprojects\sdk>gradlew buildSdk
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.11/userguide/gradle_da
emon.html.
Full Version: 3.1-stable-FINAL
POM Version: 3.1.0-stable-FINAL
NBM Revision: 1700
NBM UC Suffix: stable/3.1/plugins
:copyBaseLibs UP-TO-DATE
:copyProjectLibs UP-TO-DATE
:copyTestSources UP-TO-DATE
:createBaseXml UP-TO-DATE
:createProjectXml UP-TO-DATE
:downloadAvian FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\workspaces\privatework\gitprojects\sdk\build.gradle' line: 542

* What went wrong:
Execution failed for task ':downloadAvian'.
> java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.805 secs

That is strange, something really seems wrong with your jvm…
Anyway: Avian is the tool needed for iOS and Line 542 is:

if (!avianFile.exists())
    {
        new URL('https://bintray.com/mefisto94/jme-sdk-storage/download_file?file_path=avian-openjdk-mac.zip').withInputStream{ i -> avianFile.withOutputStream{ it << i }}
    }

So you could download that to jme3-ios/src/com/jme3/gde/ios/avian-openjdk-mac.zip
or rather comment out the downloadAvian task in buildSdk (Around line 550), since you won’t be using iOS, I guess.

1 Like

Note, if you have downloaded SDK 3.1-beta2-b001-SNAPSHOT or prior, they are based on NB8.1 not 8.2, I think. (please see here Executables on release don't run · Issue #103 · jMonkeyEngine/sdk · GitHub)
You can check it from
Help → About

1 Like

I am also having this issue. I am using jME 3.1.0 SDK.

When I open Help → About in the SDK it says it’s using NetBeans 8.2 Patch 1.

Is there any news on this?

Which of these issues? The X500Principal Access?

Yes, I mean the X500Principal Access.

https://netbeans.org/community/releases/roadmap.html
Netbeans 9.0 is scheduled to be released with around late July.
In addition to that the latest android sdk is incompatible with NBAndroid, so tough times for android support currently.

Thanks for the answers.

No easy solution for now then.

Hi,
I had the same issue.
I am not that good with all the build scripts and java. So I just went with following approach.

step 1. install 3.1-beta2-b001-SNAPSHOT into happyBuildA folder
why?
This has Netbeans 8.1 so it will be able to support android build.
step2: install jMonkeyEngine SDK 3.2.0 Preview! into happyGUIAndJ3oConverter Folder.
why?
I had a hard time converting my Make human models with 3.1-beta2-b001-SNAPSHOT.
Step3: convert blend files or use the GUI related things with “jMonkeyEngine SDK 3.2.0 Preview!” and copy final models or source files in to “3.1-beta2-b001-SNAPSHOT”

Step4: I am not sure if you use the latest engine features, if so you might need to change the libraries too.
Step5: just build for android with “3.1-beta2-b001-SNAPSHOT” (JmonkeyPlatfrom.exe -->assets folder or src folder of your project)

Note:
I am just into Jmonkey (8 days) and trying to use my Java that i learned nearly 8 years back.

any new about this error?

I checked the above link and 9.0 still isnt out yet.
However if someone can ping me when its out then I’ll take a day off to Upgrade it and various other sdk issues.

Unfortunately this wont help until nbandroid plugin is compatible with the new Android sdks and nb9 (if it isnt already built in then).

So for now it might be the best to work with the sdk and import it to Android Studio to Test it lateron (you would do most tests on desktop beforehand anyway)

Netbeans 9.0 will release whenever the Oracle jdk 9 drops, which right now is scheduled for September 21, but it’s been delayed many times now so who knows.

2 Likes