简体   繁体   中英

Using Java library with Kotlin Multiplatform

I'm looking towards expanding an Android application written in Kotlin to iOS, and I would like to use Kotlin Multiplatform for that. But since I have one big Java dependency, which is BouncyCastle, I'm not sure it's possible. Are there any alternatives for BouncyCastle for Kotlin or a way to use java library with multiplatform?

No, at least assuming you are using Kotlin Native on iOS, your not going to be able to use Bouncy Castle. If your doing something a bit weirder, like using Gluon to distribute a Java based app, then the dependency should just work. Instead you'll need to use to crypto facilities provided by iOS or another library such as CryptoSwift .

If your hoping to provide a common interface that can be used across multiple platforms, you can accomplish that with platform specific declarations , but the actual implementation is going to have to vary based on the platform.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM