Group Group Group Group Group Group Group Group Group

Build an API with Kotlin on Google Cloud Platform |

In this tutorial you will learn how to build a server side API using Kotlin and Ktor that you can host on Google Cloud Platform and use with your Android app.

This is a companion discussion topic for the original entry at

When I try to open the Ray-Conf-Starter project in IntelliJ/Android Studio and run ./gradlew appengineRun, I get an error -
Unresolved reference - kotlinx
What should I do?

Looks like @Serializable was already added to the AgendaEntry class in the starter project. All I needed to do was to add the gradle plugin and dependencies. You should move the block to add the gradle dependencies at the top or include them in the starter project

I’m also trying to execute appengineRun using the finished project and I’m getting an exception. I can’t clearly see what’s causing the exception . Thanks

> Task :server:appengineRun FAILED
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by (file:/Users/A076766/Library/Application%20Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/impl/appengine-local-runtime.jar) to method
WARNING: Please consider reporting this to the maintainers of
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
        at java.base/java.util.concurrent.ConcurrentHashMap.putVal(
        at java.base/java.util.concurrent.ConcurrentHashMap.put(
        at java.base/java.util.Properties.put(
        at java.base/java.util.Collections$CheckedMap.put(

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':server:appengineRun'.
> Non zero exit: 1

Hi Rmatze,

What you mention can sometimes occur when using a local Java SDK that is higher than the one used in the application.

Here is an example of a similar situation:

Java 9 introduced restrictions when accessing resources across packages.

Such restriction means that if an SDK is using setAccessible for a class on a separate package, then you get the error that you’ve reported.

Google makes use of reflexion in their AppEngine SDK, and therefore, we are forced to use Java 8 for now. I imagine that they’ll update bit in the future.

If you are in this situation, you have to downgrade the local Java SDK to be 8. Such downgrade may not be desirable if you have other projects that rely on newer versions of Java. On the other hand, if you are an Android developer, there is only support for Java 8, so it’s safe to downgrade. Maybe one day we can upgrade :]

If you want to switch versions quickly or to have an easier downgrade, sdkman is a great tool

Let me know if it works for you.


I’ll give it a whirl. Thanks for the quick response!

Update: Using sdkman to downgrade my java version worked as you suggested. Thanks again!

1 Like