I'm trying to build the GluonFX example project "HelloFX" as mentioned here: https://docs.gluonhq.com/#platforms_android under section 5.4.4.
The main problem is, my computer runs behind a corporate proxy and however the gluonfx build script does not use the system proxy, because after downloading all maven dependencies the build fails.
The command I'm using is mvn -Pandroid gluonfx:compile
.
Output:
julian@debian:~/Downloads/gluon-samples-master/HelloFX$ mvn -Pandroid gluonfx:compile
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.gluonhq.samples:hellofx >---------------------
[INFO] Building HelloFX 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> gluonfx-maven-plugin:1.0.16:compile (default-cli) > process-classes @ hellofx >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hellofx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ hellofx ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< gluonfx-maven-plugin:1.0.16:compile (default-cli) < process-classes @ hellofx <<<
[INFO]
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.16:compile (default-cli) @ hellofx ---
März 14, 2023 2:58:46 PM com.gluonhq.substrate.util.Logger logInfo
INFORMATION: Substrate is tested with the Gluon's GraalVM build which you can find at https://github.com/gluonhq/graal/releases.
While you can still use other GraalVM builds, there is no guarantee that these will work properly with Substrate
März 14, 2023 2:58:46 PM com.gluonhq.substrate.util.Logger logInfo
INFORMATION: ANDROID_SDK not found and will be downloaded.
März 14, 2023 2:58:46 PM com.gluonhq.substrate.util.Logger logInfo
INFORMATION: ANDROID_NDK not found and will be downloaded.
März 14, 2023 2:58:46 PM com.gluonhq.substrate.util.Logger logInfo
INFORMATION: sysroot path not found and will be downloaded.
März 14, 2023 2:58:46 PM com.gluonhq.substrate.util.Logger logInfo
INFORMATION: Downloading Java Static Libs...
März 14, 2023 2:58:47 PM com.gluonhq.substrate.util.Logger logSevere
SCHWERWIEGEND: Downloading failed: download2.gluonhq.com
Check the log files under null
And please check https://docs.gluonhq.com/ for more information.
java.lang.RuntimeException: Error downloading zips: Error: /home/julian/.gluon/substrate/staticjdk-android-aarch64-gvm-18-ea+prep18-8.zip does not exist
at com.gluonhq.substrate.util.FileDeps.setupDependencies(FileDeps.java:350)
at com.gluonhq.substrate.util.FileDeps.resolvePath(FileDeps.java:181)
at com.gluonhq.substrate.util.FileDeps.getAndroidSDKPath(FileDeps.java:125)
at com.gluonhq.substrate.target.AndroidTargetConfiguration.<init>(AndroidTargetConfiguration.java:101)
at com.gluonhq.substrate.SubstrateDispatcher.getTargetConfiguration(SubstrateDispatcher.java:402)
at com.gluonhq.substrate.SubstrateDispatcher.<init>(SubstrateDispatcher.java:387)
at com.gluonhq.NativeBaseMojo.createSubstrateDispatcher(NativeBaseMojo.java:159)
at com.gluonhq.NativeCompileMojo.execute(NativeCompileMojo.java:53)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.129 s
[INFO] Finished at: 2023-03-14T14:58:47+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.16:compile (default-cli) on project hellofx: Error: Error downloading zips: Error: /home/julian/.gluon/substrate/staticjdk-android-aarch64-gvm-18-ea+prep18-8.zip does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The proxy is configured in settings.xml as well as in the environment variables HTTP_PROXY and HTTPS_PROXY. I'm running Debian in a VM on Windows 10 and I'm using CNTLM to provide proxy authentification.
Java Version 17 GraalVM Version 17 Debian 11.6
How can i configure a proxy for the GluonFX Maven Plugin?
EDIT: I solved the first problem by using the options -Dhttp.proxyHost -Dhttp.proxyPort -Dhttps.proxyHost and -Dhttps.proxyPort
Now the next problem regarding the network connection occurs whilst fetching the Android toolchains:
INFORMATION: Downloading Android toolchain. It may take several minutes depending on your bandwidth.
März 16, 2023 2:15:58 PM com.gluonhq.substrate.util.Logger logSevere
SCHWERWIEGEND: Process sdkmanager failed with result: 1
Check the log files under null
And please check https://docs.gluonhq.com/ for more information.
März 16, 2023 2:15:58 PM com.gluonhq.substrate.util.Logger logInfo
INFORMATION: Logging process [sdkmanager] to file: /home/julian/Downloads/gluon-samples-master/HelloFX/target/gluonfx/log/process-sdkmanager-1678972558372.log
..
java.lang.RuntimeException: Error downloading zips: Could not run the Android sdk manager
at com.gluonhq.substrate.util.FileDeps.setupDependencies(FileDeps.java:350)
at com.gluonhq.substrate.util.FileDeps.resolvePath(FileDeps.java:181)
at com.gluonhq.substrate.util.FileDeps.getAndroidNDKPath(FileDeps.java:136)
at com.gluonhq.substrate.target.AndroidTargetConfiguration.<init>(AndroidTargetConfiguration.java:102)
at com.gluonhq.substrate.SubstrateDispatcher.getTargetConfiguration(SubstrateDispatcher.java:402)
at com.gluonhq.substrate.SubstrateDispatcher.<init>(SubstrateDispatcher.java:387)
at com.gluonhq.NativeBaseMojo.createSubstrateDispatcher(NativeBaseMojo.java:159)
at com.gluonhq.NativeCompileMojo.execute(NativeCompileMojo.java:53)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.067 s
[INFO] Finished at: 2023-03-16T14:15:58+01:00
[INFO] ------------------------------------------------------------------------
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.16:compile (default-cli) on project hellofx: Error: Error downloading zips: Could not run the Android sdk manager -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.746 s
[INFO] Finished at: 2023-03-16T14:15:58+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.16:build (default-cli) on project hellofx: Error, gluonfx:build failed -> [Help 1]
The log file:
Process
=======
sdkmanager
Command Line
============
/home/julian/Downloads/graalvm-svm-java17-linux-gluon-22.1.0.1-Final/bin/java -Dcom.android.sdklib.toolsdir=/home/julian/.gluon/substrate/Android/tools --illegal-access=permit -classpath /home/julian/.gluon/substrate/Android/tools/lib/*:/home/julian/.gluon/substrate/Android/tools/lib/java11/* com.android.sdklib.tool.sdkmanager.SdkManagerCli platforms;android-31 build-tools;31.0.0 platform-tools extras;android;m2repository extras;google;m2repository ndk-bundle
Output
======
OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=permit; support was removed in 17.0
Loading package information...
Loading local repository...
[ ] 3% Loading local repository...
[ ] 3% Fetch remote repository...
[ ] 3% Fetch remote repository...
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-3.xml
[ ] 3% Fetch remote repository...
[= ] 3% Fetch remote repository...
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-2.xml
[= ] 3% Fetch remote repository...
[= ] 3% Fetch remote repository...
Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-1.xml
[= ] 3% Fetch remote repository...
[= ] 3% Fetch remote repository...
Warning: Failed to download any source lists!
[= ] 3% Fetch remote repository...
Warning: File /home/julian/.android/repositories.cfg could not be loaded.
[= ] 3% Fetch remote repository...
Warning: java.net.UnknownHostException: dl.google.com
[= ] 3% Fetch remote repository...
[= ] 3% Computing updates...
[=== ] 8% Computing updates...
[=== ] 8% Computing updates...
[=== ] 10% Computing updates...
Warning: Failed to find package platforms;android-31
[=== ] 10% Computing updates...
Result
======