Alexandre G
Alexandre G

Reputation: 1693

Kotlin build problems with Android

Integrated Kotlin into a somewhat large project that uses multidex.

So when I try to build, I get this error:

:incrementalDesygnerDebugJavaCompilationSafeguard UP-TO-DATE :compileDesygnerDebugKotlin WARN: Failed to initialize native filesystem for Windows java.lang.RuntimeException: Could not find installation home path. Please make sure bin/idea.properties is present in the installation directory.

The paths seem to be configured correctly and idea.properties file seems to be there: C:\Program Files\Android\Android Studio\bin\idea.properties

The building takes a few minutes to stop, so I stop it manually from Task Manager on windows.

When I retry - the build succeeds!

But when I change a line, and rebuild it shows the same error again.

Sometimes I also get this one:

The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: PermGen space

Tried increasing all sorts of memory settings, but maybe not doing it right

org.gradle.jvmargs=-Xmx8g -XX:MaxPermSize=2048m is what I have in gradle.properties

Tried with Instant Run on and off.

Project builds fine without Kotlin, tried Android Studio 2.0 stable, Kotlin stable, Kotlin EAP and AS Canary builds.

P.S gradlew assembleDebug works every time until I try building with AS.

Edit: tried same project on:

Any ideas?

Upvotes: 2

Views: 972

Answers (1)

Alexandre G
Alexandre G

Reputation: 1693

Not sure if the errors are linked but I've found that if I remove

org.gradle.jvmargs=-Xms256m -Xmx9216M from

C:/Users/<user>/.gradle/gradle.properties file the error is still there but the build succeeds everytime.

To reiterate:

  • Kotlin + org.gradle.jvmargs=-Xms256m -Xmx9216M in gradle.properties - FAIL
  • org.gradle.jvmargs=-Xms256m -Xmx9216M in gradle.properties - OK but with above error
  • Kotlin - OK with above error

C.f. https://youtrack.jetbrains.com/issue/KT-11770

Upvotes: 1

Related Questions