ton-community / ton-kotlin

Kotlin/Multiplatform SDK for The Open Network
Apache License 2.0
109 stars 24 forks source link

Enable Android platform support #63

Open Tetraquark opened 1 year ago

Tetraquark commented 1 year ago

To use the library in Android projects, 'android()' platform support must be enabled. To do so, it need to apply Android Gradle Plugin for the configuration phase, apply android library plugin com.android.library for each multiplatofrm module, setup android configuration with fresh verisons of the android SDK (compileSdk = 33, targetSdk = 33, minSdk = 21 or older), create androidMain sourcesets and place manifest androidMain/AndroidManifest.xml to each sourceset with different packages.

And as I beleive, there are some problems with the current project configuration for multiplatform. jvmMain and androidMain - is different sourcests for KMM (because some differents with API in Java, as I understand). So, it will need to either copypaste the code of actual implementations, or rework structure of sourcesets. And it is impossible to enable two plugins at the same time in the same module - com.android.library and java. At now java plugin applied in ton-kotlin-fift module.

Some links on the topic:

Tetraquark commented 1 year ago

And some projects with KMM in which android and jvm are enabled: