https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotlin-native
  • k

    Kris Wong

    09/29/2020, 3:14 PM
    is there a good way for a callback on an iOS thread to communicate with a different thread using the latest stable coroutines?
    Channel
    is great when using native-mt, but doesn't work with stable.
    ➕ 1
    • 1
    • 2
  • d

    Diego

    09/29/2020, 3:50 PM
    Hello guys, I'm trying to setup a Kotlin multiplatform project but the build keeps failing. I'm using the following versions: kotlin version 1.3.72, coroutines version 1.3.8 and ktor version=1.3.1 Below the logs:
    > Task :compileKotlinIosArm64
    w: skipping /Users/XXX/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-ios-iosarm64/1.3.1/2f594cbbb3394fe255137a805e4b3f02bfcb5cae/ktor-client-ios.klib. The abi versions don't match. Expected '[22]', found '17'. The library produced by 1.3.61-release-13550 compiler
    e: Could not find "/Users/XXX/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-ios-iosarm64/1.3.1/2f594cbbb3394fe255137a805e4b3f02bfcb5cae/ktor-client-ios.klib" in [/Users/XXX/Documents/Development/CCC/kipling-multiplatform-spike/common, /Users/XXX/.konan/klib, /Users/XXX/.konan/kotlin-native-macos-1.3.72/klib/common, /Users/XXX/.konan/kotlin-native-macos-1.3.72/klib/platform/ios_arm64].
    I have tried changing the Kotlin version but when I do that other problems happen. I know Kotlin Multiplatform is in Alpha but it's been a painful experience just to setup the project 😭. Any help will be really appreciate it 🙂
    r
    • 2
    • 2
  • a

    Arkadii Ivanov

    09/30/2020, 9:13 AM
    Does
    atomicfu
    provide atomicity in K/N when updated concurrently from multiple threads?
    t
    • 2
    • 2
  • j

    Jamie Craane

    09/30/2020, 9:30 AM
    We have some issues migrating to Koltin 1.4.10 for our KMM project. Our current KMM project uses the following versions: Kotlin: 1.3.72 Ktor: 1.3.2 coroutines: 1.3.8 serialization: 0.20.0 We are in the process of upgrading our project to the following versions: Kotlin: 1.4.10 Ktor: 1.4.1 coroutines: 1.3.9-native-mt-2 serialization: 1.0.0-RC2 This upgrade works in our small sample app but in our producten app we get ImmutabilityExceptions. We added the ensureNeverFrozen call to better debug this issue and we are seeing that objects are getting freezed, which results in the following output in the exception (example): Caused by: kotlin.native.concurrent.FreezingException: freezing of Value(Loading(staleData=null, creationTimeStaleData=0)) has failed, first blocker is Loading(staleData=null, creationTimeStaleData=0) Since the exact same code works with the older versions, is there still some issue somewhere in ktor or coroutines library or does the native-mt-2 works differently than the single-threaded variant which now exposes a bug in our code?
    j
    r
    k
    • 4
    • 11
  • r

    ribesg

    09/30/2020, 12:30 PM
    Why do I need to mark a top-level
    const val
    as
    @SharedImmutable
    ? I mean… Can it not be?
    d
    • 2
    • 2
  • a

    aleksey.tomin

    09/30/2020, 1:05 PM
    I try to use kotlin library in iOS application. I’ve made library in path
    build/bin/iosArm64/debugFramework/XpointSdkIos.framework
    and copy this into
    build/xcode-ios-frameworks/XpointSdkIos.framework
    (from example https://github.com/Kotlin/kmm-sample/) Next I’ve added this library to Xcode project. When I try to build iOS application for iPhone Xr and I have the error
    Ignoring file .../build/xcode-ios-frameworks/XpointSdkIos.framework/XpointSdkIos, building for iOS-arm64 but attempting to link with file built for iOS Simulator-x86_64
    How can I fix it? How can I build library for
    iOS-arm64
    ?
    t
    • 2
    • 7
  • a

    Aaron Todd

    09/30/2020, 5:38 PM
    is there anyway to get a 
    ByteArray
     backed by native C memory without a copy in Kotlin/Native?
    ➕ 2
    d
    t
    • 3
    • 3
  • j

    Justin

    09/30/2020, 10:31 PM
    Is it possible to write a data class in a Kotlin Multiplatform library that, when built for macOS, conforms to Equatable (or better yet, Identifiable) out of the box?
    👀 3
    s
    l
    a
    • 4
    • 3
  • s

    Skolson5903

    10/01/2020, 8:15 PM
    Is it possible to build a kotlin native shared library for android? I have kotlin native code using cinterops working fine in other environments, and am now porting to android. I like the JniBridge code in the native samples, and would like to write the native shared library using kotlin instead of C++. But I only know how to do so using NDK and C++., Searches for gradle setup to build a shared jni library written in kotlin native for Android are coming up empty. I have everything needed for linux jvm and windows jvm shared libraries. But can't see how to build for Android. Is this doable, and if so is there a sample gradle example or doc somewhere? I'm targeting both the Arm and X86 64 bit ABIs for Android. Thanks in advance for any info..
    j
    • 2
    • 2
  • o

    Omar Mainegra

    10/02/2020, 7:11 PM
    Hi everyone, I have a cinterop with libPusher that was working fine in 1.3.72, now in 1.4.10 I'm getting a
    SIGABRT
    in
    objc_loadWeakRetained ()
    . This is the stacktrace
    #0	0x00007fff5225a33a in __pthread_kill ()
    #1	0x00007fff52304e60 in pthread_kill ()
    #2	0x00007fff521e9b7c in abort ()
    #3	0x000000010571ada9 in konan::abort() ()
    #4	0x000000010573566e in TerminateWithUnhandledException ()
    #5	0x00000001057355ba in KonanTerminateHandler() ()
    #6	0x00007fff500eec87 in std::__terminate(void (*)()) ()
    #7	0x00007fff500eec29 in std::terminate() ()
    #8	0x000000010571c571 in (anonymous namespace)::_tryRetainImp(objc_object*, objc_selector*) ()
    #9	0x00007fff512b88ce in objc_loadWeakRetained ()
    #10	0x0000000104583cf6 in -[PTPusher channelAuthorizationDelegate] at {path}/Pods/libPusher/Library/PTPusher.h:139
    #11	0x0000000104582934 in -[PTPusher subscribeToChannel:] at {path}/Pods/libPusher/Library/PTPusher.m:287
    #12	0x0000000104582d37 in -[PTPusher subscribeAll] at {path}/Pods/libPusher/Library/PTPusher.m:314
    #13	0x0000000104583278 in -[PTPusher pusherConnectionDidConnect:] at {path}/Pods/libPusher/Library/PTPusher.m:374
    #14	0x000000010458801f in -[PTPusherConnection webSocket:didReceiveMessage:] at {path}/Pods/libPusher/Library/PTPusherConnection.m:155
    #15	0x00000001047c0533 in __30-[SRWebSocket _handleMessage:]_block_invoke at {path}/Pods/SocketRocket/SocketRocket/SRWebSocket.m:836
    #16	0x000000010ace3f11 in _dispatch_call_block_and_release ()
    #17	0x000000010ace4e8e in _dispatch_client_callout ()
    #18	0x000000010acf2d97 in _dispatch_main_queue_callback_4CF ()
    #19	0x00007fff23da1869 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
    #20	0x00007fff23d9c3b9 in __CFRunLoopRun ()
    #21	0x00007fff23d9b8a4 in CFRunLoopRunSpecific ()
    #22	0x00007fff38c05bbe in GSEventRunModal ()
    #23	0x00007fff49372964 in UIApplicationMain ()
    s
    • 2
    • 4
  • i

    Iaroslav Postovalov

    10/03/2020, 3:01 PM
    Hello! What are common ways to implement CI on Windows with installing native libraries (to have them available with
    -lXXX
    flag)?
    a
    • 2
    • 4
  • i

    Iaroslav Postovalov

    10/04/2020, 11:33 AM
    There are problems with using POSIX read syscall in Mac OS X:
    • 1
    • 1
  • p

    Peter Tran

    10/04/2020, 8:04 PM
    Hello my kotlin friends! I'm developing a kotlin multiplatform project on Windows and my question is related to a kotlin native unit test. The test runs fine without a debugger. However, if I run with debugger attached then I get an error in an auto-generated file called
    ijresolvers.gradle
    :
    initialization script 'C:\Users\ptran\AppData\Local\Temp\1\ijresolvers.gradle': 268: unexpected char: '\' @ line 268, column 106.
         sk.path, 'DEBUG_SERVER_PATH=C:\Users\ptr
    The error has to do with the path separator '\'. Unfortunately I'm on Windows so the path separator needs to be double-backslash, ie
    C:\\Users\\ptr ...
    This seems it has to do with with Android Studio's JVM debugger. What tool generates the file
    ijresolvers.gradle
    ?
    a
    • 2
    • 2
  • a

    Artur Matsehor

    10/05/2020, 10:03 AM
    Hi Is there a way to make data classes with default parameter values work properly in Swift? Example:
    data class State @JvmOverloads constructor(
        val loading: Boolean = false,
        val data: ResponseBody? = null,
        val error: ApiError? = null
    )
    In Swift, it is resolved to
    init(loading: Bool, data: ResponseBody?, error: ApiError?)
    Neither with overloads or default values
    a
    • 2
    • 2
  • a

    atsushi-koshikizawa

    10/06/2020, 9:33 AM
    Is there the way to use Sentry client on Kotlin/Native?
    👀 1
    k
    • 2
    • 3
  • p

    Paul Woitaschek

    10/06/2020, 1:54 PM
    I still don't get it with KMM. Is it a new thing? Or is the shared framework / maven dependency we are using for months the same thing?
    b
    • 2
    • 3
  • m

    Matthew Laser

    10/06/2020, 6:11 PM
    Hey all - can anyone point me towards any documentation (or advice) on accessing your
    resources
    folder from a native project? I've poked around quite a bit in the old slack convos here, but I'm still not sure if this approach is still the preferred way of doing things?
    k
    • 2
    • 2
  • m

    Matthew Laser

    10/06/2020, 6:35 PM
    One more question if anyone has the time - is there a reference for the platform libraries? For isntance, I found
    MessageBoxW()
    for a Windows native dialog in the Github samples, but I'm not sure where else to look for capabilities like that
    k
    • 2
    • 3
  • l

    louiscad

    10/07/2020, 5:40 AM
    There's something called jextract that can replace JNI and is basically cinterop for the modern JVMs. https://inside.java/2020/10/06/jextract/ Would be cool to have something similar in Kotlin that is backwards compatible to JDK 8 and Android (JDK 8 desugared to JDK6/7 then .dex).
    👍 3
    g
    t
    • 3
    • 5
  • a

    aleksey.tomin

    10/07/2020, 8:00 AM
    How can I get rid of the console window in windows? I write nothing into console
    m
    • 2
    • 4
  • t

    Thomas

    10/07/2020, 6:24 PM
    Hey everyone, I am running into issues with
    AVCaptureSession
    which seems to be dropping frames when used from Kotlin Native. When running the example code below, the didDropSampleBuffer function is called a lot (see logcat). It appears that calling
    GC.collect()
    from
    didOutputSampleBuffer
    fixes the issue. Does anyone know what is going wrong here? Is it alright to call
    GC.collect()
    in this case or is the code wrong (leaking memory?)? I have also uploaded a sample project to GitHub: https://github.com/Thomas-Vos/IosAVExample. If you would like to try the code, you need to run it on a real iPhone because the simulator does not have a camera.
    AvIssueExample.kt
    • 1
    • 3
  • p

    Paul Woitaschek

    10/08/2020, 9:33 AM
    Is there a kotlin mpp implementation of gzip?
    b
    m
    c
    • 4
    • 3
  • p

    Paul Woitaschek

    10/08/2020, 11:29 AM
    Here it says: https://kotlinlang.org/docs/reference/native-overview.html
    Kotlin/Native libraries help to share Kotlin code between projects. POSIX, gzip, OpenGL, Metal, Foundation, and many other popular libraries and Apple frameworks are pre-imported and included as Kotlin/Native libraries into the compiler package.
    But I can't find anything on that. What does this mean and how can I use these?
    g
    • 2
    • 8
  • l

    Lukasz Sliwinski

    10/09/2020, 9:46 AM
    Hey everyone 👋 I know this question was asked some time ago https://kotlinlang.slack.com/archives/C3SGXARS6/p1595286014228000 but I would like to revisit @João Gonçalves 🙏. I want to make a Kotlin/Native framework that could be easily consumed by iOS and Android apps. Currently I’m trying to setup iOS part, and I wanted to achieve Cocoapods support, so it will be easy to use on iOS side. The problem is that documentation on Kotlin/Native and most of the examples that I have found that uses
    org.jetbrains.kotlin.native.cocoapods
    plugin are focused on the scenario that the Android and iOS apps are in the same mono repo and iOS app consumes the Kotlin/Native framework locally - as the added
    script_phases
    runs gradlew to adjust the used framework. But when the framework is consumed from the github via cocoapods then there there is an error
    gradlew: No such file or directory
    (https://github.com/JetBrains/kotlin-native/issues/3140). The best would be if on the consumer side java/gralde/gradlew won’t be needed which probably would require Fat framework with (arm64 and x64 binaries)
    b
    g
    j
    • 4
    • 10
  • e

    edhu

    10/10/2020, 4:17 PM
    question about cinterop: i followed this guide to setup curl for native. https://kotlinlang.org/docs/tutorials/native/curl.html now i want to do the same for gumbo-parser : https://github.com/google/gumbo-parser this is the contents of the interop.def file:
    headers = gumbo.h curl/curl.h
    headerFilter = gumbo/* curl/*
    
    compilerOpts.linux = -I/usr/include -I/usr/include/x86_64-linux-gnu -I/usr/local/Cellar/gumbo-parser/0.10.1/include
    compilerOpts.osx = -I/usr/include -I/usr/include/x86_64-linux-gnu -I/usr/local/Cellar/gumbo-parser/0.10.1/include
    linkerOpts.osx = -L/opt/local/lib -L/usr/local/opt/curl/lib -lcurl -L/usr/local/Cellar/gumbo-parser/0.10.1/lib -lgumbo
    linkerOpts.linux = -L/usr/lib/x86_64-linux-gnu -lcurl
    there are no compile errors. curl interops are still generated. but there is nothing for gumbo. this is all using the gradle plugin in intellij for macosx64. since this is not outputting anything for gumbo parser, i did it manually:
    cinterop -def interop.def -o gumbo
    and then:
    klib contents gumbo
    and this also outputs nothing. if i try it manually for curl it does output all the info. why is there nothing happening for gumbo parser? thanks in advance!
    m
    • 2
    • 2
  • i

    Iaroslav Postovalov

    10/11/2020, 7:39 AM
    How to fix issues like "no matching variant"? https://gist.github.com/CommanderTvis/f71d31bf47190b101ddcfff132a1eea1
    m
    a
    • 3
    • 2
  • c

    Christian Sousa

    10/12/2020, 4:09 PM
    Hey guys, I’m investigating for the company I work for if we can upgrade to Kotlin 1.4 (we are using Kotlin 1.3.70 right now), but when updating for 1.4.10 or even 1.4.20-M1 I get the following on iOS (we are building a multiplatform project):
    Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    Does anyone knows what might be causing this? This is not happening on our current implementation using 1.3.70, so it might be something that might’ve changed in this new release. Any help would be really nice! Thanks in advance!
    👍 1
    p
    r
    • 3
    • 3
  • i

    Iaroslav Postovalov

    10/14/2020, 5:22 PM
    Just found a weird error with cinterop on OSX.
    a
    a
    • 3
    • 9
  • i

    Iaroslav Postovalov

    10/15/2020, 7:16 AM
    I've updated by def file and gradle file: https://github.com/mipt-npm/kmath/blob/gsl-experiment/kmath-gsl/src/nativeInterop/cinterop/libgsl.def https://github.com/mipt-npm/kmath/blob/gsl-experiment/kmath-gsl/build.gradle.kts But the error didn't change: https://github.com/mipt-npm/kmath/runs/1257636736?check_suite_focus=true
    😖 2
    a
    • 2
    • 3
  • i

    Iaroslav Postovalov

    10/15/2020, 9:25 AM
    Is it possible to turn off annotator for source sets with commonized libraries?
    a
    • 2
    • 5
Powered by Linen
Title
i

Iaroslav Postovalov

10/15/2020, 9:25 AM
Is it possible to turn off annotator for source sets with commonized libraries?
Or maybe is there any workaround to register fake target to have IDE support?
a

Artyom Degtyarev [JB]

10/15/2020, 10:15 AM
Hello! As far as I can see in the build.gradle.kts, there is a single target declared. If there is a plan to build only for a host machine, why would one need common
nativeMain
at all?
i

Iaroslav Postovalov

10/15/2020, 10:18 AM
@Artyom Degtyarev [JB] I have updated it since I will need be able to publish separate targets: check https://github.com/mipt-npm/kmath/blob/gsl-experiment/kmath-gsl/build.gradle.kts
a

Artyom Degtyarev [JB]

10/15/2020, 12:20 PM
Ah, I see. Maybe you can set dependencies as described here. Move the code has to be shared to a single target source set(e.g. current OS’s one) and connect others setting the
srcDirs
. Not a beautiful option, but highlighting should start working.
i

Iaroslav Postovalov

10/15/2020, 12:33 PM
that's ruefully 😞 , since it means returning to world-before-hmpp
View count: 5