Building Kotlin Multiplatform app with Xcode Cloud - swift

as Apple announced that Xcode Cloud is now available for all developers, I tried to set it up for a Kotlin Multiplatform project. The start was a little bit hard tbh. Currently I am facing following problem during a simple test action:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
Command PhaseScriptExecution failed with a nonzero exit code
So I tried to install a jdk during the ci_post_clone.sh phase. The output of java -version after the installation on the Xcode Cloud is the following:
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
Installed java
also ./gradlew -v output:
Showing All Messages
------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.2 (Oracle Corporation 17.0.2+8-86)
OS: Mac OS X 12.4 x86_64
Nevertheless, I still get the same error. Is this maybe a restriction by Apple?
Any ideas?

Related

sdkman! How to manage pre-existing JDK?

I wanted to try Java 19 and have easy switching back to the Java 17 that I have already installed.
So, I installed sdkman but it knows nothing of the previous Java.
Found the "install local" command, used it to link the java 17 location to a unique name and sdkman seems happy, as it reports "Done installing!".
After that the "sdk current java" returns "Not using any version of java".
So then I tried "sdk use java [my unique name]. That was also accepted.
But still the "sdk current java" response is unchanged.
Have I misunderstood how this should work? I want to be sure sdkman knows what is there already before I add another Java.
Thanks for your advice!
Terminal commands follow (Kubuntu 22.04)
john#NUC8i3BEH:~$ java -version
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1-LTS, mixed mode, sharing)
john#NUC8i3BEH:~$ sdk install java 17.0.4.1-Bellsoft /usr/lib/jvm/bellsoft-java17-full-amd64
Invalid version! 17.0.4.1-Bellsoft with length 17 exceeds max of 15!
john#NUC8i3BEH:~$ sdk install java 17.0.4.1-Bell /usr/lib/jvm/bellsoft-java17-full-amd64
Linking java 17.0.4.1-Bell to /usr/lib/jvm/bellsoft-java17-full-amd64
Done installing!
john#NUC8i3BEH:~$ sdk list
john#NUC8i3BEH:~$ sdk current
No candidates are in use
john#NUC8i3BEH:~$ sdk current java
Not using any version of java
john#NUC8i3BEH:~$ sdk list java
john#NUC8i3BEH:~$ sdk use java 17.0.4.1-Bell
==== BROADCAST =================================================================
* 2022-09-21: neo4jmigrations 1.12.0 available on SDKMAN! https://github.com/michael-simons/neo4j-migrations/releases/tag/1.12.0
* 2022-09-21: micronaut 3.7.0 available on SDKMAN!
* 2022-09-20: quarkus 2.12.3.Final available on SDKMAN! https://github.com/quarkusio/quarkus/releases/tag/2.12.3.Final
================================================================================
Setting java version 17.0.4.1-Bell as default.
Using java version 17.0.4.1-Bell in this shell.
john#NUC8i3BEH:~$ java -version
openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1-LTS, mixed mode, sharing)
john#NUC8i3BEH:~$ sdk current java
Not using any version of java
john#NUC8i3BEH:~$
OK, I should have tried harder.
I installed Java 19 with sdkman then the command "sdk default java [my old version]" switches back as required.

Fastlane build failed

Im configuring the fastlane build for the first time.I don't have idea about this issue.Please help
[![Could not open settings generic class cache for settings file '/Volumes/Files/22/17/learn/uber_app/driver app new/driver_app_new/android/settings.gradle' (/Users/admin/.gradle/caches/6.6/scripts/dvrvymk2d1pk34aa6juknj4vr).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60]1]1
I changed my Java 16 version to
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
Issue resolved.
Gradle prior to 7.0 is not compatible with Java 16: GitHub: Gradle issue #13481.
Either use Gradle 7 or run Gradle using an older JDK: Using Java 16 with Gradle.

Android SDK Manager throws Exception [Java 11 issue. Please Read Description]

I'm trying to set up flutter on my Ubuntu 19.10 machine.
When I run flutter doctor --android-licenses It prompts me to update the SDK like so -
A newer version of the Android SDK is required. To update, run:
/home/<username>/Android/SDK/tools/bin/sdkmanager --update
When I run it, I encounter an Exception - java.lang.NoClassDefFoundError
This answer suggests changing DEFAULT_JVM_OPTS in sdkmanager to
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" --add-modules java.xml.bind'
This seems to work in Java 9/10. However, I use Java 11 and unfortunately the java.xml.bind module and java.se.ee module has been discontinued from Java 11 -
java version "11.0.6" 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
Is there a way to fix this in Java 11? Or do I have to downgrade to Java 9/10?
flutter supports java 1.8
so, try install java 1.8

java web start fails to locate java runtime

Hi I am trying to run javaws but it prompts:
To open this Web Start application you need to download the Java Runtime Environment.
I am sure JRE is installed, maybe javaws does not find it, how do I fix that?
Johns-MacBook-Pro:~ johnmactavish$ java --version
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Johns-MacBook-Pro:~ johnmactavish$ javaws
No Java runtime present, requesting install.
Unable to locate a Java Runtime to invoke.
Johns-MacBook-Pro:~ johnmactavish$
Java Web Start (javaws) was deprecated in Java 9 and removed in Java 11.
As you are using java 13, you can either downgrade from 13 to 8, or look for alternatives.
Perhaps an alternative such as https://openwebstart.com/ can help you out with that.
P.S: In case you're using tools to manage version such as sdkman or such, there might be the case where it's also not available in SDKs # version 8 provided by sdkman.

Flutter and java sdk

i've reached a brickwall with java.
$ flutter doctor --android-licenses
A newer version of the Android SDK is required. To update, run:
/Users/simonhampton/Library/Android/sdk/tools/bin/sdkmanager --update
$ /Users/simonhampton/Library/Android/sdk/tools/bin/sdkmanager --update
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
I have
$ java --version
java 12.0.2 2019-07-16
Java(TM) SE Runtime Environment (build 12.0.2+10)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
I feel like I've installed everything possible - jre, jdk, dfk, openadk,....and nothing works. Is there a guaranteed solution to make java work?
Try it with java 8 SDK or versions before it, Not after this version.