Search Feedback

178
votes

Possibility to use kotlin native language with unity 3d

General

-

-

Possibility to use kotlin native language with unity 3d.

As it is now possible to compile kotlin natively, it can be theorically possible to use unity3d in addition.
It should be great to be able to use kotlin with unity 3d.

Comments (8)

  1. 3b6a33f6f51ec31db794d08fcafc853e?d=mm

    EloiNavarro

    Apr 19, 2018 09:47

    I was having the same doubts as YURY-HABETS.
    But since this idea seems to refer to "use Kotlin as a scripting language in Unity, in addition to C# (over .NET)".
    I created a new post asking for the other interpretation: "use Kotlin as a source for Android plugins compiled at build time."

    https://feedback.unity3d.com/suggestions/use-kotlin-as-androids-native-language

  2. 4fd1abace2bf570d4139bde0afc49699?d=mm

    liusilong007

    Mar 08, 2018 09:04

    I want to use Kotlin as a source for Android plugins compiled at build time. But now it will report an error. as follows:

    AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
    java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
    at com.lsl.plugin.PluginActivity.showToast(PluginActivity.kt)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source)
    at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
    at android.os.Handler.dispatchMessage(Handler.java)
    at android.os.Looper.loop(Looper.java)
    at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "/data/app/com.lsl.aardemo-1/base.apk"],nativeLibraryDirectories=[/data/app/com.lsl.aardemo-1/lib/arm, /data/app/com.lsl.aardemo-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassL

  3. C884e0846a36a892c2ba0c3d752c81a8?d=mm

    KirkBushman

    Feb 26, 2018 09:24

    Zimm is kinda right, being able to compile natively isn't much but:
    With the kotlin2Js plugin you can convert kotlin code to javascript, at that point you would only need a wrapper in kotlin for the Unity libs.

    Like they did with react here: https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-react

  4. 081f28ccf55646e6fe54c9c2aa890aca?d=mm

    Yury-Habets

    Jan 19, 2018 11:03

    The comments seem to mean two things:
    - use Kotlin as a scripting language in Unity, in addition to C# (over .NET)
    - use Kotlin as a source for Android plugins compiled at build time.

    Which one are you voting for?

  5. 689e3a29d94289e589fbd141eb34e648?d=mm

    Haapavuo

    Jan 10, 2018 18:46

    Why is this suggestion not visible on the top list since it already has over 60 votes?

  6. 093d627d14a97f7d89810a9b92dabdc5?d=mm

    schumnana

    Nov 25, 2017 16:53

    Kotlin can run on jvm, native but also on JavaScript Platform. As it run on JavaScript Platform, it can be used theorically with unity, isn't it?

  7. C2778d4182b1b39798b1e8e74dd2e143?d=mm

    Fydar

    Aug 24, 2017 10:55

    I agree with Zimm on this one, does not even work under the .NET Runtime.

    I'm sure if you really wanted the feature you could implement it yourself. Check out this page:

    https://docs.unity3d.com/Manual/NativePlugins.html

  8. 06d317c4ab1b8c0cc5bd4e9c4717ed8a?d=mm

    ZimM

    Aug 24, 2017 08:25

    There is no connection between being able to compile kotlin natively and being able to use it in Unity. In fact, you can't. IMHO Kotlin would have to work under .NET runtime before it could be even considered...

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(9807)

2D

(259)

Ads

(49)

AI & Navigation

(77)

Analytics

(113)

Animation

(359)

Asset Store

(264)

Assets

(508)

Audio

(166)

Cloud Build

(117)

Collaborate

(44)

Docs & Tutorials

(216)

Editor

(2267)

Everyplay

(13)

Game Performance Reporting

(16)

General

(880)

Graphics

(812)

GUI

(394)

Input

(155)

Licensing

(82)

Networking

(173)

Physics

(361)

Platforms

(425)

Profiling & Optimization

(76)

Runtime

(168)

Scripting

(1086)

Terrain

(162)

WebGL

(138)